-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: pending_messages constraints (#681)
* Fix: pending_messages constraint should have `sender` `item_hash` `signature` * fix: unused import
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
deployment/migrations/versions/0029_46f7e55ff55c_fix_uniqueconstraint_should_have_sender_.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 @@ | ||
"""Fix: UniqueCOnstraint should have sender item_hash and signature | ||
Revision ID: 46f7e55ff55c | ||
Revises: edb195b0ed62 | ||
Create Date: 2025-01-14 17:51:43.357255 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '46f7e55ff55c' | ||
down_revision = 'edb195b0ed62' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.drop_constraint('uq_pending_message', 'pending_messages', type_='unique') | ||
op.create_unique_constraint('uq_pending_message', 'pending_messages', ['sender', 'item_hash', 'signature']) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_constraint('uq_pending_message', 'pending_messages', type_='unique') | ||
op.create_unique_constraint('uq_pending_message', 'pending_messages', ['item_hash']) |
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