Rewrite migrations

This commit is contained in:
Midgard 2020-07-25 12:14:23 +02:00
parent db8fc1920c
commit 10568e2b3d
Signed by: midgard
GPG key ID: 511C112F1331BBB4
5 changed files with 12 additions and 69 deletions

View file

@ -1,5 +1,6 @@
# Generated by Django 3.0.8 on 2020-07-22 16:03 # Generated by Django 3.0.8 on 2020-07-25 10:14
from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -9,6 +10,7 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
@ -19,6 +21,8 @@ class Migration(migrations.Migration):
('date', models.DateField()), ('date', models.DateField()),
('time', models.IntegerField(choices=[(0, 'voormiddag'), (1, 'namiddag'), (2, 'avond')], default=0)), ('time', models.IntegerField(choices=[(0, 'voormiddag'), (1, 'namiddag'), (2, 'avond')], default=0)),
('capacity', models.IntegerField(default=6)), ('capacity', models.IntegerField(default=6)),
('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)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
@ -27,6 +31,11 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state', models.CharField(choices=[('I', 'op wachtlijst'), ('A', 'bevestigd')], max_length=1)), ('state', models.CharField(choices=[('I', 'op wachtlijst'), ('A', 'bevestigd')], max_length=1)),
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Event')), ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Event')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
), ),
migrations.AddConstraint(
model_name='eventregistration',
constraint=models.UniqueConstraint(fields=('event', 'user'), name='register_only_once'),
),
] ]

View file

@ -1,27 +0,0 @@
# Generated by Django 3.0.8 on 2020-07-22 16:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('events', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='eventregistration',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddConstraint(
model_name='eventregistration',
constraint=models.UniqueConstraint(fields=('event', 'user'), name='register_only_once'),
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.0.8 on 2020-07-25 00:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0002_auto_20200722_1803'),
]
operations = [
migrations.AddField(
model_name='event',
name='note',
field=models.TextField(default='', max_length=1024),
),
]

View file

@ -1,21 +0,0 @@
# Generated by Django 3.0.8 on 2020-07-25 00:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('events', '0003_event_note'),
]
operations = [
migrations.AddField(
model_name='event',
name='responsible_person',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
]

View file

@ -23,8 +23,8 @@ class Migration(migrations.Migration):
('zeus_id', models.IntegerField(null=True, unique=True)), ('zeus_id', models.IntegerField(null=True, unique=True)),
('is_staff', models.BooleanField(default=False)), ('is_staff', models.BooleanField(default=False)),
('username', models.CharField(max_length=50, unique=True)), ('username', models.CharField(max_length=50, unique=True)),
('student_number', models.CharField(max_length=255)), ('student_number', models.CharField(max_length=255, verbose_name='Studentennummer')),
('real_name', models.CharField(max_length=100)), ('real_name', models.CharField(max_length=100, verbose_name='Echte naam')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now)), ('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),