"""empty message

Revision ID: 2d614148ea4b
Revises: 
Create Date: 2022-03-17 22:29:00.613962

"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
import sqlmodel # added
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '2d614148ea4b'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('description', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('first_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('last_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_superuser', sa.Boolean(), nullable=True),
    sa.Column('birthdate', sa.DateTime(), nullable=True),
    sa.Column('phone', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('state', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('country', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('address', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_hashed_password'), 'user', ['hashed_password'], unique=False)
    op.create_table('textinference',
    sa.Column('result', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.Column('text', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('created_by_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_textinference_text'), 'textinference', ['text'], unique=False)
    op.create_table('zeroshotinference',
    sa.Column('candidate_labels', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.Column('result', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.Column('text', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('created_by_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['created_by_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_zeroshotinference_text'), 'zeroshotinference', ['text'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_zeroshotinference_text'), table_name='zeroshotinference')
    op.drop_table('zeroshotinference')
    op.drop_index(op.f('ix_textinference_text'), table_name='textinference')
    op.drop_table('textinference')
    op.drop_index(op.f('ix_user_hashed_password'), table_name='user')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    op.drop_table('role')
    # ### end Alembic commands ###

sqlalchemy.ForeignKeyConstraint sqlalchemy.DateTime alembic.op.drop_table alembic.op.f sqlalchemy.Boolean sqlalchemy.PrimaryKeyConstraint sqlalchemy.Text sqlalchemy.Integer sqlmodel.sql.sqltypes.AutoString
[((3708, 3742), 'alembic.op.drop_table', 'op.drop_table', (['"""zeroshotinference"""'], {}), "('zeroshotinference')\n", (3721, 3742), False, 'from alembic import op\n'), ((3824, 3854), 'alembic.op.drop_table', 'op.drop_table', (['"""textinference"""'], {}), "('textinference')\n", (3837, 3854), False, 'from alembic import op\n'), ((3989, 4010), 'alembic.op.drop_table', 'op.drop_table', (['"""user"""'], {}), "('user')\n", (4002, 4010), False, 'from alembic import op\n'), ((4015, 4036), 'alembic.op.drop_table', 'op.drop_table', (['"""role"""'], {}), "('role')\n", (4028, 4036), False, 'from alembic import op\n'), ((806, 835), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (829, 835), True, 'import sqlalchemy as sa\n'), ((1899, 1948), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['role_id']", "['role.id']"], {}), "(['role_id'], ['role.id'])\n", (1922, 1948), True, 'import sqlalchemy as sa\n'), ((1956, 1985), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1979, 1985), True, 'import sqlalchemy as sa\n'), ((2012, 2033), 'alembic.op.f', 'op.f', (['"""ix_user_email"""'], {}), "('ix_user_email')\n", (2016, 2033), False, 'from alembic import op\n'), ((2087, 2118), 'alembic.op.f', 'op.f', (['"""ix_user_hashed_password"""'], {}), "('ix_user_hashed_password')\n", (2091, 2118), False, 'from alembic import op\n'), ((2589, 2644), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['created_by_id']", "['user.id']"], {}), "(['created_by_id'], ['user.id'])\n", (2612, 2644), True, 'import sqlalchemy as sa\n'), ((2652, 2681), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (2675, 2681), True, 'import sqlalchemy as sa\n'), ((2708, 2737), 'alembic.op.f', 'op.f', (['"""ix_textinference_text"""'], {}), "('ix_textinference_text')\n", (2712, 2737), False, 'from alembic import op\n'), ((3300, 3355), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['created_by_id']", "['user.id']"], {}), "(['created_by_id'], ['user.id'])\n", (3323, 3355), True, 'import sqlalchemy as sa\n'), ((3363, 3392), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (3386, 3392), True, 'import sqlalchemy as sa\n'), ((3419, 3452), 'alembic.op.f', 'op.f', (['"""ix_zeroshotinference_text"""'], {}), "('ix_zeroshotinference_text')\n", (3423, 3452), False, 'from alembic import op\n'), ((3637, 3670), 'alembic.op.f', 'op.f', (['"""ix_zeroshotinference_text"""'], {}), "('ix_zeroshotinference_text')\n", (3641, 3670), False, 'from alembic import op\n'), ((3761, 3790), 'alembic.op.f', 'op.f', (['"""ix_textinference_text"""'], {}), "('ix_textinference_text')\n", (3765, 3790), False, 'from alembic import op\n'), ((3873, 3904), 'alembic.op.f', 'op.f', (['"""ix_user_hashed_password"""'], {}), "('ix_user_hashed_password')\n", (3877, 3904), False, 'from alembic import op\n'), ((3943, 3964), 'alembic.op.f', 'op.f', (['"""ix_user_email"""'], {}), "('ix_user_email')\n", (3947, 3964), False, 'from alembic import op\n'), ((498, 532), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (530, 532), False, 'import sqlmodel\n'), ((580, 614), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (612, 614), False, 'import sqlmodel\n'), ((653, 665), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (663, 665), True, 'import sqlalchemy as sa\n'), ((712, 725), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (723, 725), True, 'import sqlalchemy as sa\n'), ((771, 784), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (782, 784), True, 'import sqlalchemy as sa\n'), ((898, 932), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (930, 932), False, 'import sqlmodel\n'), ((978, 1012), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1010, 1012), False, 'import sqlmodel\n'), ((1054, 1088), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1086, 1088), False, 'import sqlmodel\n'), ((1133, 1145), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (1143, 1145), True, 'import sqlalchemy as sa\n'), ((1193, 1205), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (1203, 1205), True, 'import sqlalchemy as sa\n'), ((1250, 1263), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1261, 1263), True, 'import sqlalchemy as sa\n'), ((1304, 1338), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1336, 1338), False, 'import sqlmodel\n'), ((1379, 1413), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1411, 1413), False, 'import sqlmodel\n'), ((1456, 1490), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1488, 1490), False, 'import sqlmodel\n'), ((1533, 1567), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1565, 1567), False, 'import sqlmodel\n'), ((1613, 1626), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1624, 1626), True, 'import sqlalchemy as sa\n'), ((1672, 1685), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1683, 1685), True, 'import sqlalchemy as sa\n'), ((1723, 1735), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1733, 1735), True, 'import sqlalchemy as sa\n'), ((1787, 1821), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1819, 1821), False, 'import sqlmodel\n'), ((1865, 1877), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1875, 1877), True, 'import sqlalchemy as sa\n'), ((2302, 2336), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (2334, 2336), False, 'import sqlmodel\n'), ((2375, 2387), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (2385, 2387), True, 'import sqlalchemy as sa\n'), ((2434, 2447), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (2445, 2447), True, 'import sqlalchemy as sa\n'), ((2493, 2506), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (2504, 2506), True, 'import sqlalchemy as sa\n'), ((2555, 2567), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (2565, 2567), True, 'import sqlalchemy as sa\n'), ((3013, 3047), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (3045, 3047), False, 'import sqlmodel\n'), ((3086, 3098), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (3096, 3098), True, 'import sqlalchemy as sa\n'), ((3145, 3158), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (3156, 3158), True, 'import sqlalchemy as sa\n'), ((3204, 3217), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (3215, 3217), True, 'import sqlalchemy as sa\n'), ((3266, 3278), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (3276, 3278), True, 'import sqlalchemy as sa\n'), ((2252, 2261), 'sqlalchemy.Text', 'sa.Text', ([], {}), '()\n', (2259, 2261), True, 'import sqlalchemy as sa\n'), ((2883, 2892), 'sqlalchemy.Text', 'sa.Text', ([], {}), '()\n', (2890, 2892), True, 'import sqlalchemy as sa\n'), ((2963, 2972), 'sqlalchemy.Text', 'sa.Text', ([], {}), '()\n', (2970, 2972), True, 'import sqlalchemy as sa\n')]