diff --git a/ereuse_devicehub/migrations/versions/51439cf24be8_change_trade_action.py b/ereuse_devicehub/migrations/versions/51439cf24be8_change_trade_action.py index 24948e49..4b836a9d 100644 --- a/ereuse_devicehub/migrations/versions/51439cf24be8_change_trade_action.py +++ b/ereuse_devicehub/migrations/versions/51439cf24be8_change_trade_action.py @@ -76,6 +76,17 @@ def upgrade(): 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 op.add_column('user', sa.Column('active', sa.Boolean(), default=True, nullable=True), schema='common') @@ -90,6 +101,8 @@ def upgrade(): def downgrade(): 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', sa.Column('shipping_date', sa.TIMESTAMP(timezone=True), nullable=True, comment='When are the devices going to be ready \n \