-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PC-30509)[BO] feat: validate constraint cancellation_user_fk for boo…
…king and collective booking
- Loading branch information
1 parent
055999b
commit 9d9eb33
Showing
4 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
d3e56f793b31 (pre) (head) | ||
84359b3cc978 (post) (head) | ||
257bb3c980a7 (post) (head) |
2 changes: 1 addition & 1 deletion
2
...s/20240807T141040_b0b1f2a95d61_add_cancellationauthor_to_collective_booking_foreignkey.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...versions/20240819T092711_e068f2c51128_validate_constraint_booking_cancellation_user_fk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
25 changes: 25 additions & 0 deletions
25
...240819T093330_257bb3c980a7_validate_constraint_collective_booking_cancellation_user_fk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |