-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ref #806: prevent duplicate entries in pending records table
- Loading branch information
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
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
32 changes: 32 additions & 0 deletions
32
migrations/versions/20230915_375dd57cfed1_add_unicity_constraint_in_pending_.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,32 @@ | ||
"""Add unicity constraint in pending records | ||
Revision ID: 375dd57cfed1 | ||
Revises: 8f93a0e590f0 | ||
Create Date: 2023-09-15 10:11:28.618091 | ||
""" | ||
# pylint: disable=no-member invalid-name | ||
# no-member is triggered by alembic.op, which has dynamically added functions | ||
# invalid-name is triggered by migration file names with a date prefix | ||
# invalid-name is triggered by top-level alembic constants like revision instead of REVISION | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "375dd57cfed1" # pragma: allowlist secret | ||
down_revision = "8f93a0e590f0" # pragma: allowlist secret | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_unique_constraint("uix_pr_email_id", "pending_acoustic", ["email_id"]) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint("uix_pr_email_id", "pending_acoustic", type_="unique") | ||
# ### end Alembic commands ### |
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