membershipworks: Constrain EventMeetingTime.end
after start
All checks were successful
Ruff / ruff (push) Successful in 24s
All checks were successful
Ruff / ruff (push) Successful in 24s
This commit is contained in:
parent
8e0848ecab
commit
dd6ef35223
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.0.2 on 2024-02-12 21:24
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("membershipworks", "0014_remove_eventext_details_timestamp"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddConstraint(
|
||||||
|
model_name="eventmeetingtime",
|
||||||
|
constraint=models.CheckConstraint(
|
||||||
|
check=models.Q(("end__gt", models.F("start"))), name="end_after_start"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@ -565,7 +565,8 @@ class EventMeetingTime(models.Model):
|
|||||||
constraints = [
|
constraints = [
|
||||||
models.UniqueConstraint(
|
models.UniqueConstraint(
|
||||||
fields=["event", "start", "end"], name="unique_event_start_end"
|
fields=["event", "start", "end"], name="unique_event_start_end"
|
||||||
)
|
),
|
||||||
|
models.CheckConstraint(check=Q(end__gt=F("start")), name="end_after_start"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user