add alembic
This commit is contained in:
		
							
								
								
									
										37
									
								
								alembic/versions/d487ed348c4c_add_user.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								alembic/versions/d487ed348c4c_add_user.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
"""add user
 | 
			
		||||
 | 
			
		||||
Revision ID: d487ed348c4c
 | 
			
		||||
Revises:
 | 
			
		||||
Create Date: 2024-05-23 22:06:52.412454
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
from typing import Sequence, Union
 | 
			
		||||
 | 
			
		||||
import sqlalchemy as sa
 | 
			
		||||
 | 
			
		||||
from alembic import op
 | 
			
		||||
 | 
			
		||||
# revision identifiers, used by Alembic.
 | 
			
		||||
revision: str = "d487ed348c4c"
 | 
			
		||||
down_revision: Union[str, None] = None
 | 
			
		||||
branch_labels: Union[str, Sequence[str], None] = None
 | 
			
		||||
depends_on: Union[str, Sequence[str], None] = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def upgrade() -> None:
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.create_table(
 | 
			
		||||
        "users",
 | 
			
		||||
        sa.Column("id", sa.Integer(), nullable=False),
 | 
			
		||||
        sa.Column("name", sa.String(), nullable=False),
 | 
			
		||||
        sa.Column("email", sa.String(), nullable=False),
 | 
			
		||||
        sa.PrimaryKeyConstraint("id"),
 | 
			
		||||
    )
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def downgrade() -> None:
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.drop_table("users")
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
		Reference in New Issue
	
	Block a user