Skip to content

Commit dbf5679

Browse files
authored
Merge pull request #4514 from alphagov/nhistory-composite-templates-index
Add composite template index on notification history
2 parents 06a8490 + a7cd961 commit dbf5679

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

migrations/.current-alembic-head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0507_n_history_service_id_index
1+
0508_n_history_templates_index
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Create Date: 2025-07-07 11:03:04.356066
3+
"""
4+
5+
from alembic import op
6+
7+
revision = '0508_n_history_templates_index'
8+
down_revision = '0507_n_history_service_id_index'
9+
10+
11+
def upgrade():
12+
with op.get_context().autocommit_block():
13+
op.execute(
14+
"CREATE INDEX CONCURRENTLY IF NOT EXISTS ix_notification_history_template_composite on notification_history (template_id, template_version)"
15+
)
16+
17+
18+
def downgrade():
19+
with op.get_context().autocommit_block():
20+
op.execute(
21+
"DROP INDEX CONCURRENTLY IF EXISTS ix_notification_history_template_composite"
22+
)

0 commit comments

Comments
 (0)