Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """add_replen_optimizer
- Revision ID: 972d36690057
- Revises: dc22d519a911
- Create Date: 2023-05-10 16:21:42.211076
- """
- from alembic import op
- import sqlalchemy as sa
- import clickhouse_sqlalchemy.types.common as common
- from clickhouse_sqlalchemy import engines
- # revision identifiers, used by Alembic.
- revision = '972d36690057'
- down_revision = 'dc22d519a911'
- branch_labels = None
- depends_on = None
- def upgrade():
- op.create_table(
- 'replenishment_forecasts_hub',
- sa.Column('id', common.UUID, primary_key=True),
- sa.Column('scenario_id', common.UInt32, nullable=False),
- sa.Column('art_code_nm', common.String(), nullable=False),
- sa.Column('nub_nm', common.String(), nullable=False),
- sa.Column('fc_1', common.Uint32),
- sa.Column('fc_2', common.Uint32),
- sa.Column('fc_3', common.Uint32),
- sa.Column('fc_4', common.Uint32),
- sa.Column('fc_5', common.Uint32),
- sa.Column('fc_6', common.Uint32),
- engines.MergeTree(order_by=['scenario_id']),
- )
- op.create_table(
- 'replenishment_forecasts_region',
- sa.Column('id', common.UUID, primary_key=True),
- sa.Column('scenario_id', common.UInt32, nullable=False),
- sa.Column('art_code_nm', common.String(255), nullable=False),
- sa.Column('region_nm', common.String(255), nullable=False),
- sa.Column('fc_1', common.Uint32),
- sa.Column('fc_2', common.Uint32),
- sa.Column('fc_3', common.Uint32),
- sa.Column('fc_4', common.Uint32),
- sa.Column('fc_5', common.Uint32),
- sa.Column('fc_6', common.Uint32),
- engines.MergeTree(order_by=['scenario_id']),
- )
- op.create_table(
- 'replenishment_hub_stocks_data',
- sa.Column('id', common.UUID, primary_key=True),
- sa.Column('scenario_id', common.UInt32, nullable=False),
- sa.Column('art_code_nm', common.String(255), nullable=False),
- sa.Column('hub_nm', common.String(255), nullable=False),
- sa.Column('stock', common.Uint32),
- engines.MergeTree(order_by=['scenario_id']),
- )
- op.create_table(
- 'replenishment_region_stocks_data',
- sa.Column('id', common.UUID, primary_key=True),
- sa.Column('scenario_id', common.UInt32, nullable=False),
- sa.Column('art_code_nm', common.String(255), nullable=False),
- sa.Column('region_nm', common.String(255), nullable=False),
- sa.Column('stock', common.Uint32),
- engines.MergeTree(order_by=['scenario_id']),
- )
- op.create_table(
- 'replenishment_result',
- sa.Column('id', common.UUID, primary_key=True),
- sa.Column('scenario_id', common.UInt32, nullable=False),
- sa.Column('art_code_nm', common.String(255), nullable=False),
- sa.Column('source_stock', common.Uint32,),
- sa.Column('final_source_stock', common.Uint32,),
- sa.Column('cover_source', common.Uint32,),
- sa.Column('final_cover_source', common.Uint32,),
- sa.Column('target_cover_source', common.Uint32,),
- sa.Column('destination_stock', common.Uint32,),
- sa.Column('final_destination_stock', common.Uint32,),
- sa.Column('cover_destination', common.Uint32,),
- sa.Column('final_cover_destination', common.Uint32,),
- sa.Column('target_cover_destination', common.Uint32,),
- sa.Column('calculated_transfer', common.Uint32,),
- sa.Column('manual_correction', common.Uint32,),
- sa.Column('final_transfer', common.Uint32,),
- engines.MergeTree(order_by=['scenario_id']),
- )
- def downgrade():
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement