"""init_db

Revision ID: 23799b5136c5
Revises: 
Create Date: 2021-12-11 00:49:58.116933

"""
from alembic import op
import sqlalchemy as sa
import sqlmodel


# revision identifiers, used by Alembic.
revision = '23799b5136c5'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=True),
    sa.Column('full_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_superuser', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=False)
    op.create_index(op.f('ix_user_full_name'), 'user', ['full_name'], unique=False)
    op.create_index(op.f('ix_user_hashed_password'), 'user', ['hashed_password'], unique=False)
    op.create_index(op.f('ix_user_id'), 'user', ['id'], unique=False)
    op.create_index(op.f('ix_user_is_active'), 'user', ['is_active'], unique=False)
    op.create_index(op.f('ix_user_is_superuser'), 'user', ['is_superuser'], unique=False)
    op.create_table('task',
    sa.Column('status', sa.Enum('draft', 'in_process', 'delete', 'done', name='taskstatus'), nullable=True),
    sa.Column('id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_task_created_at'), 'task', ['created_at'], unique=False)
    op.create_index(op.f('ix_task_id'), 'task', ['id'], unique=False)
    op.create_index(op.f('ix_task_title'), 'task', ['title'], unique=False)
    op.create_index(op.f('ix_task_user_id'), 'task', ['user_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_task_user_id'), table_name='task')
    op.drop_index(op.f('ix_task_title'), table_name='task')
    op.drop_index(op.f('ix_task_id'), table_name='task')
    op.drop_index(op.f('ix_task_created_at'), table_name='task')
    op.drop_table('task')
    op.drop_index(op.f('ix_user_is_superuser'), table_name='user')
    op.drop_index(op.f('ix_user_is_active'), table_name='user')
    op.drop_index(op.f('ix_user_id'), table_name='user')
    op.drop_index(op.f('ix_user_hashed_password'), table_name='user')
    op.drop_index(op.f('ix_user_full_name'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    # ### end Alembic commands ###
sqlalchemy.ForeignKeyConstraint sqlalchemy.DateTime alembic.op.drop_table alembic.op.f sqlalchemy.Boolean sqlalchemy.PrimaryKeyConstraint sqlalchemy.Integer sqlmodel.sql.sqltypes.AutoString sqlalchemy.Enum
[((2498, 2519), 'alembic.op.drop_table', 'op.drop_table', (['"""task"""'], {}), "('task')\n", (2511, 2519), False, 'from alembic import op\n'), ((2906, 2927), 'alembic.op.drop_table', 'op.drop_table', (['"""user"""'], {}), "('user')\n", (2919, 2927), False, 'from alembic import op\n'), ((808, 837), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (831, 837), True, 'import sqlalchemy as sa\n'), ((864, 885), 'alembic.op.f', 'op.f', (['"""ix_user_email"""'], {}), "('ix_user_email')\n", (868, 885), False, 'from alembic import op\n'), ((940, 965), 'alembic.op.f', 'op.f', (['"""ix_user_full_name"""'], {}), "('ix_user_full_name')\n", (944, 965), False, 'from alembic import op\n'), ((1024, 1055), 'alembic.op.f', 'op.f', (['"""ix_user_hashed_password"""'], {}), "('ix_user_hashed_password')\n", (1028, 1055), False, 'from alembic import op\n'), ((1120, 1138), 'alembic.op.f', 'op.f', (['"""ix_user_id"""'], {}), "('ix_user_id')\n", (1124, 1138), False, 'from alembic import op\n'), ((1190, 1215), 'alembic.op.f', 'op.f', (['"""ix_user_is_active"""'], {}), "('ix_user_is_active')\n", (1194, 1215), False, 'from alembic import op\n'), ((1274, 1302), 'alembic.op.f', 'op.f', (['"""ix_user_is_superuser"""'], {}), "('ix_user_is_superuser')\n", (1278, 1302), False, 'from alembic import op\n'), ((1725, 1774), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['user_id']", "['user.id']"], {}), "(['user_id'], ['user.id'])\n", (1748, 1774), True, 'import sqlalchemy as sa\n'), ((1782, 1811), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1805, 1811), True, 'import sqlalchemy as sa\n'), ((1838, 1864), 'alembic.op.f', 'op.f', (['"""ix_task_created_at"""'], {}), "('ix_task_created_at')\n", (1842, 1864), False, 'from alembic import op\n'), ((1924, 1942), 'alembic.op.f', 'op.f', (['"""ix_task_id"""'], {}), "('ix_task_id')\n", (1928, 1942), False, 'from alembic import op\n'), ((1994, 2015), 'alembic.op.f', 'op.f', (['"""ix_task_title"""'], {}), "('ix_task_title')\n", (1998, 2015), False, 'from alembic import op\n'), ((2070, 2093), 'alembic.op.f', 'op.f', (['"""ix_task_user_id"""'], {}), "('ix_task_user_id')\n", (2074, 2093), False, 'from alembic import op\n'), ((2268, 2291), 'alembic.op.f', 'op.f', (['"""ix_task_user_id"""'], {}), "('ix_task_user_id')\n", (2272, 2291), False, 'from alembic import op\n'), ((2330, 2351), 'alembic.op.f', 'op.f', (['"""ix_task_title"""'], {}), "('ix_task_title')\n", (2334, 2351), False, 'from alembic import op\n'), ((2390, 2408), 'alembic.op.f', 'op.f', (['"""ix_task_id"""'], {}), "('ix_task_id')\n", (2394, 2408), False, 'from alembic import op\n'), ((2447, 2473), 'alembic.op.f', 'op.f', (['"""ix_task_created_at"""'], {}), "('ix_task_created_at')\n", (2451, 2473), False, 'from alembic import op\n'), ((2538, 2566), 'alembic.op.f', 'op.f', (['"""ix_user_is_superuser"""'], {}), "('ix_user_is_superuser')\n", (2542, 2566), False, 'from alembic import op\n'), ((2605, 2630), 'alembic.op.f', 'op.f', (['"""ix_user_is_active"""'], {}), "('ix_user_is_active')\n", (2609, 2630), False, 'from alembic import op\n'), ((2669, 2687), 'alembic.op.f', 'op.f', (['"""ix_user_id"""'], {}), "('ix_user_id')\n", (2673, 2687), False, 'from alembic import op\n'), ((2726, 2757), 'alembic.op.f', 'op.f', (['"""ix_user_hashed_password"""'], {}), "('ix_user_hashed_password')\n", (2730, 2757), False, 'from alembic import op\n'), ((2796, 2821), 'alembic.op.f', 'op.f', (['"""ix_user_full_name"""'], {}), "('ix_user_full_name')\n", (2800, 2821), False, 'from alembic import op\n'), ((2860, 2881), 'alembic.op.f', 'op.f', (['"""ix_user_email"""'], {}), "('ix_user_email')\n", (2864, 2881), False, 'from alembic import op\n'), ((416, 428), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (426, 428), True, 'import sqlalchemy as sa\n'), ((473, 507), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (505, 507), False, 'import sqlmodel\n'), ((549, 583), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (581, 583), False, 'import sqlmodel\n'), ((634, 668), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (666, 668), False, 'import sqlmodel\n'), ((714, 726), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (724, 726), True, 'import sqlalchemy as sa\n'), ((774, 786), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (784, 786), True, 'import sqlalchemy as sa\n'), ((1396, 1463), 'sqlalchemy.Enum', 'sa.Enum', (['"""draft"""', '"""in_process"""', '"""delete"""', '"""done"""'], {'name': '"""taskstatus"""'}), "('draft', 'in_process', 'delete', 'done', name='taskstatus')\n", (1403, 1463), True, 'import sqlalchemy as sa\n'), ((1501, 1513), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1511, 1513), True, 'import sqlalchemy as sa\n'), ((1559, 1572), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1570, 1572), True, 'import sqlalchemy as sa\n'), ((1613, 1647), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1645, 1647), False, 'import sqlmodel\n'), ((1691, 1703), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1701, 1703), True, 'import sqlalchemy as sa\n')]