-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/fides/api/alembic/migrations/versions/52b2cfd1af47_fix_messaging_template_indexes.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,38 @@ | ||
"""fix message template indexes | ||
Revision ID: 52b2cfd1af47 | ||
Revises: f17f92237383 | ||
Create Date: 2023-09-15 21:29:23.060892 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "52b2cfd1af47" | ||
down_revision = "f17f92237383" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.drop_index("ix_messagingtemplate_id", table_name="messaging_template") | ||
op.drop_index("ix_messagingtemplate_key", table_name="messaging_template") | ||
op.create_index( | ||
op.f("ix_messaging_template_id"), "messaging_template", ["id"], unique=False | ||
) | ||
op.create_index( | ||
op.f("ix_messaging_template_key"), "messaging_template", ["key"], unique=True | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_index(op.f("ix_messaging_template_key"), table_name="messaging_template") | ||
op.drop_index(op.f("ix_messaging_template_id"), table_name="messaging_template") | ||
op.create_index( | ||
"ix_messagingtemplate_key", "messaging_template", ["key"], unique=False | ||
) | ||
op.create_index( | ||
"ix_messagingtemplate_id", "messaging_template", ["id"], unique=False | ||
) |
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