2020-07-25 12:14:23 +02:00
|
|
|
# Generated by Django 3.0.8 on 2020-07-25 10:14
|
2020-07-22 04:18:57 +02:00
|
|
|
|
2020-07-25 12:14:23 +02:00
|
|
|
from django.conf import settings
|
2020-07-22 04:18:57 +02:00
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
2020-07-25 12:14:23 +02:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2020-07-22 04:18:57 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Event',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('date', models.DateField()),
|
2020-07-22 18:19:42 +02:00
|
|
|
('time', models.IntegerField(choices=[(0, 'voormiddag'), (1, 'namiddag'), (2, 'avond')], default=0)),
|
2020-07-22 04:18:57 +02:00
|
|
|
('capacity', models.IntegerField(default=6)),
|
2020-07-25 12:14:23 +02:00
|
|
|
('note', models.TextField(default='', max_length=1024)),
|
|
|
|
('responsible_person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
|
2020-07-22 04:18:57 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='EventRegistration',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
2020-07-22 18:19:42 +02:00
|
|
|
('state', models.CharField(choices=[('I', 'op wachtlijst'), ('A', 'bevestigd')], max_length=1)),
|
2020-07-22 04:18:57 +02:00
|
|
|
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Event')),
|
2020-07-25 12:14:23 +02:00
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
2020-07-22 04:18:57 +02:00
|
|
|
],
|
|
|
|
),
|
2020-07-25 12:14:23 +02:00
|
|
|
migrations.AddConstraint(
|
|
|
|
model_name='eventregistration',
|
|
|
|
constraint=models.UniqueConstraint(fields=('event', 'user'), name='register_only_once'),
|
|
|
|
),
|
2020-07-22 04:18:57 +02:00
|
|
|
]
|