From 4afa6e495ba363dcc331bcdeae3cf05ce94983cb Mon Sep 17 00:00:00 2001 From: Pierre Narcisi Date: Tue, 23 Jan 2024 12:06:31 +0100 Subject: [PATCH] fix(occtax) switch default value between sexe and object denombrement --- .../43ecf0836b4a_invert_count_default.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 contrib/occtax/backend/occtax/migrations/43ecf0836b4a_invert_count_default.py diff --git a/contrib/occtax/backend/occtax/migrations/43ecf0836b4a_invert_count_default.py b/contrib/occtax/backend/occtax/migrations/43ecf0836b4a_invert_count_default.py new file mode 100644 index 0000000000..965bd4dae9 --- /dev/null +++ b/contrib/occtax/backend/occtax/migrations/43ecf0836b4a_invert_count_default.py @@ -0,0 +1,34 @@ +"""invert count default + +Revision ID: 43ecf0836b4a +Revises: e170d1902137 +Create Date: 2024-01-23 09:36:40.189931 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "43ecf0836b4a" +down_revision = "e170d1902137" +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute( + """ + + ALTER TABLE pr_occtax.cor_counting_occtax + ALTER COLUMN id_nomenclature_sex SET DEFAULT pr_occtax.get_default_nomenclature_value('SEXE'); + + ALTER TABLE pr_occtax.cor_counting_occtax + ALTER COLUMN id_nomenclature_obj_count SET DEFAULT pr_occtax.get_default_nomenclature_value('OBJ_DENBR'); + + """ + ) + + +def downgrade(): + pass