From 94ddc76e1748bb1afd6ae70f4ab3f1d4a60dd6f7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 21 Jun 2023 12:47:41 +0200 Subject: [PATCH] fix sequence in database --- .../versions/8334535d56fa_add_digital_passport_dpp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ereuse_devicehub/modules/dpp/migrations/versions/8334535d56fa_add_digital_passport_dpp.py b/ereuse_devicehub/modules/dpp/migrations/versions/8334535d56fa_add_digital_passport_dpp.py index 0687992e..97cfe6ba 100644 --- a/ereuse_devicehub/modules/dpp/migrations/versions/8334535d56fa_add_digital_passport_dpp.py +++ b/ereuse_devicehub/modules/dpp/migrations/versions/8334535d56fa_add_digital_passport_dpp.py @@ -121,11 +121,15 @@ def upgrade(): sa.PrimaryKeyConstraint('id'), schema=f'{get_inv()}', ) + op.execute(f"CREATE SEQUENCE {get_inv()}.proof_seq START 1;") + op.execute(f"CREATE SEQUENCE {get_inv()}.dpp_seq START 1;") def downgrade(): op.drop_table('dpp', schema=f'{get_inv()}') op.drop_table('proof', schema=f'{get_inv()}') + op.execute(f"DROP SEQUENCE {get_inv()}.proof_seq;") + op.execute(f"DROP SEQUENCE {get_inv()}.dpp_seq;") # op.drop_index(op.f('ix_proof_created'), table_name='proof', schema=f'{get_inv()}') # op.drop_index(op.f('ix_proof_timestamp'), table_name='proof', schema=f'{get_inv()}') op.drop_column('snapshot', 'phid_dpp', schema=f'{get_inv()}')