adding tradenote to migration

This commit is contained in:
Cayo Puigdefabregas 2021-04-20 16:26:58 +02:00
parent 6822c5bbf8
commit c6f908041b
1 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,17 @@ def upgrade():
schema=f'{get_inv()}' schema=f'{get_inv()}'
) )
op.create_table('tradenote',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('trade_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['id'], [f'{get_inv()}.action.id'], ),
sa.ForeignKeyConstraint(['trade_id'], [f'{get_inv()}.trade.id'], ),
sa.PrimaryKeyConstraint('id'),
schema=f'{get_inv()}'
)
## User ## User
op.add_column('user', sa.Column('active', sa.Boolean(), default=True, nullable=True), op.add_column('user', sa.Column('active', sa.Boolean(), default=True, nullable=True),
schema='common') schema='common')
@ -90,6 +101,8 @@ def upgrade():
def downgrade(): def downgrade():
op.drop_table('trade', schema=f'{get_inv()}') op.drop_table('trade', schema=f'{get_inv()}')
op.drop_table('confirm', schema=f'{get_inv()}')
op.drop_table('tradenote', schema=f'{get_inv()}')
op.create_table('trade', op.create_table('trade',
sa.Column('shipping_date', sa.TIMESTAMP(timezone=True), nullable=True, sa.Column('shipping_date', sa.TIMESTAMP(timezone=True), nullable=True,
comment='When are the devices going to be ready \n \ comment='When are the devices going to be ready \n \