2
0
Fork 0
This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-04-27 16:36:34 +02:00
parent 944d21f681
commit 5e039d6bf5
2 changed files with 130 additions and 40 deletions

View File

@ -10,63 +10,136 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = []
]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Helper', name="Helper",
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), (
('phone', phonenumber_field.modelfields.PhoneNumberField(editable=False, max_length=128, region=None, unique=True)), "id",
('name', models.CharField(max_length=200)), models.BigAutoField(
('number_validated', models.BooleanField(default=False)), auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"phone",
phonenumber_field.modelfields.PhoneNumberField(
editable=False, max_length=128, region=None, unique=True
),
),
("name", models.CharField(max_length=200)),
("number_validated", models.BooleanField(default=False)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Room', name="Room",
fields=[ fields=[
('name', models.CharField(max_length=200, primary_key=True, serialize=False)), (
('required_helpers', models.IntegerField()), "name",
models.CharField(max_length=200, primary_key=True, serialize=False),
),
("required_helpers", models.IntegerField()),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Shift', name="Shift",
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), (
('start_at', models.DateTimeField()), "id",
('duration', models.DurationField()), models.BigAutoField(
('deleted', models.BooleanField(default=False)), auto_created=True,
('room', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='app.room')), primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("start_at", models.DateTimeField()),
("duration", models.DurationField()),
("deleted", models.BooleanField(default=False)),
(
"room",
models.ForeignKey(
on_delete=django.db.models.deletion.RESTRICT, to="app.room"
),
),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Message', name="Message",
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), (
('text', models.CharField(max_length=160)), "id",
('created_at', models.DateTimeField(auto_now_add=True)), models.BigAutoField(
('to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("text", models.CharField(max_length=160)),
("created_at", models.DateTimeField(auto_now_add=True)),
(
"to",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="app.helper"
),
),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='LoginToken', name="LoginToken",
fields=[ fields=[
('id', models.CharField(default=shiftregister.app.models.gen_token, editable=False, max_length=20, primary_key=True, serialize=False)), (
('sent_at', models.DateTimeField(auto_now_add=True)), "id",
('helper', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), models.CharField(
default=shiftregister.app.models.gen_token,
editable=False,
max_length=20,
primary_key=True,
serialize=False,
),
),
("sent_at", models.DateTimeField(auto_now_add=True)),
(
"helper",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="app.helper"
),
),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='ShiftRegistration', name="ShiftRegistration",
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), (
('reminder_sent', models.BooleanField(default=False)), "id",
('helper', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), models.BigAutoField(
('shift', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='app.shift')), auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("reminder_sent", models.BooleanField(default=False)),
(
"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={ options={
'unique_together': {('shift', 'helper')}, "unique_together": {("shift", "helper")},
}, },
), ),
] ]

View File

@ -9,24 +9,41 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('app', '0001_initial'), ("app", "0001_initial"),
] ]
operations = [ operations = [
migrations.CreateModel( migrations.CreateModel(
name='Calendar', name="Calendar",
fields=[ fields=[
('url', models.URLField(primary_key=True, serialize=False)), ("url", models.URLField(primary_key=True, serialize=False)),
('has_errors', models.BooleanField(default=False, editable=False)), ("has_errors", models.BooleanField(default=False, editable=False)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Event', name="Event",
fields=[ fields=[
('shift_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='app.shift')), (
('uuid', models.UUIDField(editable=False, primary_key=True, serialize=False)), "shift_ptr",
('calendar', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='importer.calendar')), models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
to="app.shift",
),
),
(
"uuid",
models.UUIDField(editable=False, primary_key=True, serialize=False),
),
(
"calendar",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="importer.calendar",
),
),
], ],
bases=('app.shift',), bases=("app.shift",),
), ),
] ]