generated from bisco/codex-bootstrap
feat: add initial Django domain models
This commit is contained in:
54
backend/checkins/migrations/0001_initial.py
Normal file
54
backend/checkins/migrations/0001_initial.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# Generated by Django 5.2.3 on 2026-04-28
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
("bookings", "0001_initial"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="CheckIn",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("checked_in_at", models.DateTimeField(default=django.utils.timezone.now)),
|
||||
(
|
||||
"source",
|
||||
models.CharField(choices=[("qr_scan", "QR scan"), ("manual", "Manual")], default="qr_scan", max_length=20),
|
||||
),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"checked_in_by",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name="checkins",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
(
|
||||
"reservation",
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
related_name="check_in",
|
||||
to="bookings.reservation",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-checked_in_at"],
|
||||
"indexes": [
|
||||
models.Index(fields=["checked_in_at"], name="checkins_ch_checked_761e33_idx"),
|
||||
models.Index(fields=["checked_in_by"], name="checkins_ch_checked_becaae_idx"),
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user