"""Initial model generation

Revision ID: a2ced875a244
Revises: 
Create Date: 2021-10-28 09:24:53.225445

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


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('category',
    sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('playlists', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_category_id'), 'category', ['id'], unique=False)
    op.create_index(op.f('ix_category_name'), 'category', ['name'], unique=False)
    op.create_index(op.f('ix_category_playlists'), 'category', ['playlists'], unique=False)
    op.create_table('user',
    sa.Column('entity_id', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('last_login', sa.DateTime(), nullable=True),
    sa.Column('admin', sa.Boolean(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=True),
    sa.Column('password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_admin'), 'user', ['admin'], unique=False)
    op.create_index(op.f('ix_user_created_at'), 'user', ['created_at'], unique=False)
    op.create_index(op.f('ix_user_entity_id'), 'user', ['entity_id'], unique=False)
    op.create_index(op.f('ix_user_id'), 'user', ['id'], unique=False)
    op.create_index(op.f('ix_user_last_login'), 'user', ['last_login'], unique=False)
    op.create_index(op.f('ix_user_name'), 'user', ['name'], unique=False)
    op.create_index(op.f('ix_user_password'), 'user', ['password'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_password'), table_name='user')
    op.drop_index(op.f('ix_user_name'), table_name='user')
    op.drop_index(op.f('ix_user_last_login'), table_name='user')
    op.drop_index(op.f('ix_user_id'), table_name='user')
    op.drop_index(op.f('ix_user_entity_id'), table_name='user')
    op.drop_index(op.f('ix_user_created_at'), table_name='user')
    op.drop_index(op.f('ix_user_admin'), table_name='user')
    op.drop_table('user')
    op.drop_index(op.f('ix_category_playlists'), table_name='category')
    op.drop_index(op.f('ix_category_name'), table_name='category')
    op.drop_index(op.f('ix_category_id'), table_name='category')
    op.drop_table('category')
    # ### end Alembic commands ###

alembic.op.drop_table sqlalchemy.DateTime alembic.op.f sqlmodel.sql.sqltypes.AutoString sqlalchemy.PrimaryKeyConstraint sqlalchemy.Boolean sqlalchemy.Integer
[((2554, 2575), 'alembic.op.drop_table', 'op.drop_table', (['"""user"""'], {}), "('user')\n", (2567, 2575), False, 'from alembic import op\n'), ((2784, 2809), 'alembic.op.drop_table', 'op.drop_table', (['"""category"""'], {}), "('category')\n", (2797, 2809), False, 'from alembic import op\n'), ((626, 655), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (649, 655), True, 'import sqlalchemy as sa\n'), ((682, 704), 'alembic.op.f', 'op.f', (['"""ix_category_id"""'], {}), "('ix_category_id')\n", (686, 704), False, 'from alembic import op\n'), ((760, 784), 'alembic.op.f', 'op.f', (['"""ix_category_name"""'], {}), "('ix_category_name')\n", (764, 784), False, 'from alembic import op\n'), ((842, 871), 'alembic.op.f', 'op.f', (['"""ix_category_playlists"""'], {}), "('ix_category_playlists')\n", (846, 871), False, 'from alembic import op\n'), ((1403, 1432), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1426, 1432), True, 'import sqlalchemy as sa\n'), ((1459, 1480), 'alembic.op.f', 'op.f', (['"""ix_user_admin"""'], {}), "('ix_user_admin')\n", (1463, 1480), False, 'from alembic import op\n'), ((1535, 1561), 'alembic.op.f', 'op.f', (['"""ix_user_created_at"""'], {}), "('ix_user_created_at')\n", (1539, 1561), False, 'from alembic import op\n'), ((1621, 1646), 'alembic.op.f', 'op.f', (['"""ix_user_entity_id"""'], {}), "('ix_user_entity_id')\n", (1625, 1646), False, 'from alembic import op\n'), ((1705, 1723), 'alembic.op.f', 'op.f', (['"""ix_user_id"""'], {}), "('ix_user_id')\n", (1709, 1723), False, 'from alembic import op\n'), ((1775, 1801), 'alembic.op.f', 'op.f', (['"""ix_user_last_login"""'], {}), "('ix_user_last_login')\n", (1779, 1801), False, 'from alembic import op\n'), ((1861, 1881), 'alembic.op.f', 'op.f', (['"""ix_user_name"""'], {}), "('ix_user_name')\n", (1865, 1881), False, 'from alembic import op\n'), ((1935, 1959), 'alembic.op.f', 'op.f', (['"""ix_user_password"""'], {}), "('ix_user_password')\n", (1939, 1959), False, 'from alembic import op\n'), ((2135, 2159), 'alembic.op.f', 'op.f', (['"""ix_user_password"""'], {}), "('ix_user_password')\n", (2139, 2159), False, 'from alembic import op\n'), ((2198, 2218), 'alembic.op.f', 'op.f', (['"""ix_user_name"""'], {}), "('ix_user_name')\n", (2202, 2218), False, 'from alembic import op\n'), ((2257, 2283), 'alembic.op.f', 'op.f', (['"""ix_user_last_login"""'], {}), "('ix_user_last_login')\n", (2261, 2283), False, 'from alembic import op\n'), ((2322, 2340), 'alembic.op.f', 'op.f', (['"""ix_user_id"""'], {}), "('ix_user_id')\n", (2326, 2340), False, 'from alembic import op\n'), ((2379, 2404), 'alembic.op.f', 'op.f', (['"""ix_user_entity_id"""'], {}), "('ix_user_entity_id')\n", (2383, 2404), False, 'from alembic import op\n'), ((2443, 2469), 'alembic.op.f', 'op.f', (['"""ix_user_created_at"""'], {}), "('ix_user_created_at')\n", (2447, 2469), False, 'from alembic import op\n'), ((2508, 2529), 'alembic.op.f', 'op.f', (['"""ix_user_admin"""'], {}), "('ix_user_admin')\n", (2512, 2529), False, 'from alembic import op\n'), ((2594, 2623), 'alembic.op.f', 'op.f', (['"""ix_category_playlists"""'], {}), "('ix_category_playlists')\n", (2598, 2623), False, 'from alembic import op\n'), ((2666, 2690), 'alembic.op.f', 'op.f', (['"""ix_category_name"""'], {}), "('ix_category_name')\n", (2670, 2690), False, 'from alembic import op\n'), ((2733, 2755), 'alembic.op.f', 'op.f', (['"""ix_category_id"""'], {}), "('ix_category_id')\n", (2737, 2755), False, 'from alembic import op\n'), ((439, 473), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (471, 473), False, 'import sqlmodel\n'), ((519, 553), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (551, 553), False, 'import sqlmodel\n'), ((592, 604), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (602, 604), True, 'import sqlalchemy as sa\n'), ((969, 1003), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1001, 1003), False, 'import sqlmodel\n'), ((1044, 1078), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1076, 1078), False, 'import sqlmodel\n'), ((1125, 1138), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1136, 1138), True, 'import sqlalchemy as sa\n'), ((1185, 1198), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1196, 1198), True, 'import sqlalchemy as sa\n'), ((1239, 1251), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (1249, 1251), True, 'import sqlalchemy as sa\n'), ((1290, 1302), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (1300, 1302), True, 'import sqlalchemy as sa\n'), ((1346, 1380), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (1378, 1380), False, 'import sqlmodel\n')]