"""full structure Revision ID: 60e8f49dee49 Revises: Create Date: 2022-02-03 19:24:24.715589 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '60e8f49dee49' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('brand', sa.Column('id', sa.Integer(), nullable=False), sa.Column('name', sa.String(length=32), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('category', sa.Column('id', sa.Integer(), nullable=False), sa.Column('name', sa.String(length=32), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('user', sa.Column('id', sa.String(length=10), nullable=False), sa.Column('name', sa.String(length=64), nullable=True), sa.Column('password_hash', sa.String(length=128), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('item', sa.Column('id', sa.BigInteger(), nullable=False), sa.Column('name', sa.String(length=64), nullable=True), sa.Column('brand', sa.Integer(), nullable=True), sa.Column('description', sa.Text(), nullable=True), sa.ForeignKeyConstraint(['brand'], ['brand.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('amount_change', sa.Column('item', sa.BigInteger(), nullable=False), sa.Column('date', sa.Date(), nullable=False), sa.Column('amount', sa.SmallInteger(), nullable=True), sa.ForeignKeyConstraint(['item'], ['item.id'], ), sa.PrimaryKeyConstraint('item', 'date') ) op.create_table('bought', sa.Column('user', sa.String(length=10), nullable=False), sa.Column('item', sa.BigInteger(), nullable=False), sa.Column('date', sa.Date(), nullable=False), sa.Column('amount', sa.SmallInteger(), nullable=True), sa.ForeignKeyConstraint(['item'], ['item.id'], ), sa.ForeignKeyConstraint(['user'], ['user.id'], ), sa.PrimaryKeyConstraint('user', 'item', 'date') ) op.create_table('item_category', sa.Column('item', sa.BigInteger(), nullable=False), sa.Column('category', sa.Integer(), nullable=False), sa.ForeignKeyConstraint(['category'], ['category.id'], ), sa.ForeignKeyConstraint(['item'], ['item.id'], ), sa.PrimaryKeyConstraint('item', 'category') ) op.create_table('price_change', sa.Column('item', sa.BigInteger(), nullable=False), sa.Column('date', sa.Date(), nullable=False), sa.Column('price', sa.SmallInteger(), nullable=True), sa.ForeignKeyConstraint(['item'], ['item.id'], ), sa.PrimaryKeyConstraint('item', 'date') ) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_table('price_change') op.drop_table('item_category') op.drop_table('bought') op.drop_table('amount_change') op.drop_table('item') op.drop_table('user') op.drop_table('category') op.drop_table('brand') # ### end Alembic commands ###