Skip to content

Commit 8c8d4ec

Browse files
committed
add nbss_id as index to Appointments
To more efficiently search for them in `create_appointments` command
1 parent e7ab74a commit 8c8d4ec

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 5.2.3 on 2025-08-26 11:17
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('notifications', '0014_remove_blob_name_from_appointments'),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name='appointment',
15+
index=models.Index(fields=['nbss_id'], name='notificatio_nbss_id_b218dc_idx'),
16+
),
17+
]

manage_breast_screening/notifications/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ class Appointment(models.Model):
109109
The screening appointment used to build the message.
110110
"""
111111

112+
class Meta:
113+
indexes = [models.Index(fields=["nbss_id"])]
114+
112115
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
113116
batch_id = models.CharField(max_length=30, default="")
114117
nbss_id = models.CharField(max_length=30, unique=True)

0 commit comments

Comments
 (0)