48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
|
"""Innitial commit
|
||
|
|
||
|
Revision ID: 31cd88d78cb4
|
||
|
Revises:
|
||
|
Create Date: 2024-01-21 14:31:12.188455
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '31cd88d78cb4'
|
||
|
down_revision = None
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('session',
|
||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
sa.Column('name', sa.String(), nullable=False),
|
||
|
sa.Column('authorized', sa.Boolean(), nullable=False),
|
||
|
sa.PrimaryKeyConstraint('id'),
|
||
|
sa.UniqueConstraint('name')
|
||
|
)
|
||
|
op.create_table('user',
|
||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
sa.Column('first_name', sa.String(), nullable=True),
|
||
|
sa.Column('last_name', sa.String(), nullable=True),
|
||
|
sa.Column('phone', sa.String(), nullable=True),
|
||
|
sa.Column('username', sa.String(), nullable=True),
|
||
|
sa.Column('session_id', sa.Integer(), nullable=True),
|
||
|
sa.ForeignKeyConstraint(['session_id'], ['session.id'], ),
|
||
|
sa.PrimaryKeyConstraint('id'),
|
||
|
sa.UniqueConstraint('phone'),
|
||
|
sa.UniqueConstraint('username')
|
||
|
)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_table('user')
|
||
|
op.drop_table('session')
|
||
|
# ### end Alembic commands ###
|