57 lines
1.9 KiB
Python
57 lines
1.9 KiB
Python
"""empty message
|
|
|
|
Revision ID: b3639db87e06
|
|
Revises:
|
|
Create Date: 2022-07-11 17:09:20.502213
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'b3639db87e06'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('products',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.String(length=128), nullable=False),
|
|
sa.Column('category', sa.String(length=128), nullable=False),
|
|
sa.Column('notes', sa.String(), nullable=True),
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
sa.Column('modified_at', sa.DateTime(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_products_category'), 'products', ['category'], unique=False)
|
|
op.create_table('sigl_config',
|
|
sa.Column('key', sa.String(), nullable=False),
|
|
sa.Column('value', sa.String(length=128), nullable=True),
|
|
sa.PrimaryKeyConstraint('key')
|
|
)
|
|
op.create_table('product_locations',
|
|
sa.Column('product_id', sa.Integer(), nullable=False),
|
|
sa.Column('store', sa.String(length=128), nullable=False),
|
|
sa.Column('aisle', sa.String(length=64), nullable=False),
|
|
sa.Column('bin', sa.String(length=64), nullable=True),
|
|
sa.Column('notes', sa.String(), nullable=True),
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
sa.Column('modified_at', sa.DateTime(), nullable=True),
|
|
sa.ForeignKeyConstraint(['product_id'], ['products.id'], ),
|
|
sa.PrimaryKeyConstraint('product_id', 'store')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('product_locations')
|
|
op.drop_table('sigl_config')
|
|
op.drop_index(op.f('ix_products_category'), table_name='products')
|
|
op.drop_table('products')
|
|
# ### end Alembic commands ###
|