diff --git a/api/alembic_version_conflict_detection.txt b/api/alembic_version_conflict_detection.txt index ee2af6c38ec..eeffa90b292 100644 --- a/api/alembic_version_conflict_detection.txt +++ b/api/alembic_version_conflict_detection.txt @@ -1,2 +1,2 @@ d3e56f793b31 (pre) (head) -84359b3cc978 (post) (head) +257bb3c980a7 (post) (head) diff --git a/api/src/pcapi/alembic/versions/20240807T141040_b0b1f2a95d61_add_cancellationauthor_to_collective_booking_foreignkey.py b/api/src/pcapi/alembic/versions/20240807T141040_b0b1f2a95d61_add_cancellationauthor_to_collective_booking_foreignkey.py index d87aee075ae..54a664c409a 100644 --- a/api/src/pcapi/alembic/versions/20240807T141040_b0b1f2a95d61_add_cancellationauthor_to_collective_booking_foreignkey.py +++ b/api/src/pcapi/alembic/versions/20240807T141040_b0b1f2a95d61_add_cancellationauthor_to_collective_booking_foreignkey.py @@ -1,5 +1,5 @@ """ -add cancellationUser to collective booking foreignkey +add cancellationUser to booking foreignkey """ from alembic import op diff --git a/api/src/pcapi/alembic/versions/20240819T092711_e068f2c51128_validate_constraint_booking_cancellation_user_fk.py b/api/src/pcapi/alembic/versions/20240819T092711_e068f2c51128_validate_constraint_booking_cancellation_user_fk.py new file mode 100644 index 00000000000..0214fc35eb6 --- /dev/null +++ b/api/src/pcapi/alembic/versions/20240819T092711_e068f2c51128_validate_constraint_booking_cancellation_user_fk.py @@ -0,0 +1,25 @@ +""" +validate constraint booking_cancellation_user_fk +""" + +from alembic import op + +from pcapi import settings + + +# pre/post deployment: post +# revision identifiers, used by Alembic. +revision = "e068f2c51128" +down_revision = "84359b3cc978" +branch_labels: tuple[str] | None = None +depends_on: list[str] | None = None + + +def upgrade() -> None: + op.execute("SET SESSION statement_timeout='300s'") # or more if needed + op.execute("""ALTER TABLE booking VALIDATE CONSTRAINT "booking_cancellation_user_fk" """) + op.execute(f"SET SESSION statement_timeout={settings.DATABASE_STATEMENT_TIMEOUT}") + + +def downgrade() -> None: + pass diff --git a/api/src/pcapi/alembic/versions/20240819T093330_257bb3c980a7_validate_constraint_collective_booking_cancellation_user_fk.py b/api/src/pcapi/alembic/versions/20240819T093330_257bb3c980a7_validate_constraint_collective_booking_cancellation_user_fk.py new file mode 100644 index 00000000000..43ecbf3e3ad --- /dev/null +++ b/api/src/pcapi/alembic/versions/20240819T093330_257bb3c980a7_validate_constraint_collective_booking_cancellation_user_fk.py @@ -0,0 +1,25 @@ +""" +validate constraint collective booking_cancellation_user_fk +""" + +from alembic import op + +from pcapi import settings + + +# pre/post deployment: post +# revision identifiers, used by Alembic. +revision = "257bb3c980a7" +down_revision = "e068f2c51128" +branch_labels: tuple[str] | None = None +depends_on: list[str] | None = None + + +def upgrade() -> None: + op.execute("SET SESSION statement_timeout='300s'") # or more if needed + op.execute("""ALTER TABLE collective_booking VALIDATE CONSTRAINT "collective_booking_cancellation_user_fk" """) + op.execute(f"SET SESSION statement_timeout={settings.DATABASE_STATEMENT_TIMEOUT}") + + +def downgrade() -> None: + pass