38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
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",
|
|
),
|
|
],
|
|
},
|
|
),
|
|
]
|