shiftregister/shiftregister/app/migrations/0001_initial.py

130 lines
3.9 KiB
Python

# Generated by Django 4.0.4 on 2022-04-12 12:19
from django.db import migrations, models
import django.db.models.deletion
import shiftregister.app.models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Helper",
fields=[
(
"phone",
models.CharField(max_length=200, primary_key=True, serialize=False),
),
("name", models.CharField(max_length=200)),
("number_validated", models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name="Room",
fields=[
(
"name",
models.CharField(max_length=200, primary_key=True, serialize=False),
),
("required_helpers", models.IntegerField()),
],
),
migrations.CreateModel(
name="Shift",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("start_at", models.DateTimeField()),
("duration", models.DurationField()),
(
"room",
models.ForeignKey(
on_delete=django.db.models.deletion.RESTRICT, to="app.room"
),
),
],
),
migrations.CreateModel(
name="Message",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("text", models.CharField(max_length=160)),
(
"to",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="app.helper"
),
),
],
),
migrations.CreateModel(
name="LoginToken",
fields=[
(
"id",
models.CharField(
default=shiftregister.app.models.gen_token,
editable=False,
max_length=20,
primary_key=True,
serialize=False,
),
),
(
"helper",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="app.helper"
),
),
],
),
migrations.CreateModel(
name="ShiftRegistration",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"helper",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="app.helper"
),
),
(
"shift",
models.ForeignKey(
on_delete=django.db.models.deletion.RESTRICT, to="app.shift"
),
),
],
options={
"unique_together": {("shift", "helper")},
},
),
]