-
-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add more missing indices for mailbox delete (#2321)
- Loading branch information
1 parent
dd2cfae
commit 8320cc0
Showing
2 changed files
with
34 additions
and
1 deletion.
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
29 changes: 29 additions & 0 deletions
29
migrations/versions/2024_111410_12274da2299f_add_missing_indices_on_email_log.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,29 @@ | ||
"""add missing indices on email log | ||
Revision ID: 12274da2299f | ||
Revises: 842ac670096e | ||
Create Date: 2024-11-14 10:27:20.371191 | ||
""" | ||
import sqlalchemy_utils | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '12274da2299f' | ||
down_revision = '842ac670096e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.get_context().autocommit_block(): | ||
op.create_index('ix_email_log_bounced_mailbox_id', 'email_log', ['bounced_mailbox_id'], unique=False) | ||
op.create_index('ix_email_log_mailbox_id', 'email_log', ['mailbox_id'], unique=False) | ||
|
||
|
||
def downgrade(): | ||
with op.get_context().autocommit_block(): | ||
op.drop_index('ix_email_log_mailbox_id', table_name='email_log') | ||
op.drop_index('ix_email_log_bounced_mailbox_id', table_name='email_log') |