fix(events): keep registration status reads nonblocking
This commit is contained in:
37
apps/events/migrations/0017_registrationnotification.py
Normal file
37
apps/events/migrations/0017_registrationnotification.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("events", "0016_registration_cancellation_reason_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="RegistrationNotification",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("kind", models.CharField(choices=[("confirmed", "Confirmed"), ("cancelled", "Cancelled")], max_length=10)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("delivered_at", models.DateTimeField(blank=True, null=True)),
|
||||
("lease_until", models.DateTimeField(blank=True, null=True)),
|
||||
(
|
||||
"registration",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="notification_outbox",
|
||||
to="events.registration",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"constraints": [
|
||||
models.UniqueConstraint(
|
||||
fields=("registration", "kind"),
|
||||
name="unique_registration_notification",
|
||||
),
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.2.5 on 2026-10-01 09:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('events', '0017_registrationnotification'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name='registrationnotification',
|
||||
index=models.Index(condition=models.Q(('delivered_at__isnull', True)), fields=['lease_until', 'created_at'], name='reg_notif_pending_idx'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user