57 lines
1.8 KiB
Python
57 lines
1.8 KiB
Python
|
# Generated by Django 5.0.1 on 2024-02-09 16:37
|
||
|
|
||
|
import django.db.models.deletion
|
||
|
from django.db import migrations, models
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
dependencies = [
|
||
|
("doorcontrol", "0004_hidevent_is_red"),
|
||
|
("membershipworks", "0014_remove_eventext_details_timestamp"),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.CreateModel(
|
||
|
name="DoorCardholderMember",
|
||
|
fields=[
|
||
|
(
|
||
|
"id",
|
||
|
models.BigAutoField(
|
||
|
auto_created=True,
|
||
|
primary_key=True,
|
||
|
serialize=False,
|
||
|
verbose_name="ID",
|
||
|
),
|
||
|
),
|
||
|
("cardholder_id", models.IntegerField()),
|
||
|
(
|
||
|
"door",
|
||
|
models.ForeignKey(
|
||
|
on_delete=django.db.models.deletion.CASCADE,
|
||
|
to="doorcontrol.door",
|
||
|
),
|
||
|
),
|
||
|
(
|
||
|
"member",
|
||
|
models.ForeignKey(
|
||
|
db_constraint=False,
|
||
|
on_delete=django.db.models.deletion.CASCADE,
|
||
|
to="membershipworks.member",
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
migrations.AddConstraint(
|
||
|
model_name="doorcardholdermember",
|
||
|
constraint=models.UniqueConstraint(
|
||
|
fields=("door", "cardholder_id"), name="unique_door_cardholder_id"
|
||
|
),
|
||
|
),
|
||
|
migrations.AddConstraint(
|
||
|
model_name="doorcardholdermember",
|
||
|
constraint=models.UniqueConstraint(
|
||
|
fields=("door", "member"), name="unique_door_member"
|
||
|
),
|
||
|
),
|
||
|
]
|