From 29202a528ae5e9fd8ce7bfb1f7cb7ad5ae93f613 Mon Sep 17 00:00:00 2001 From: Midgard Date: Wed, 22 Jul 2020 04:18:57 +0200 Subject: [PATCH] I wanted to go party but migrations were fucked --- events/migrations/0001_initial.py | 32 +++++++++++++++++++ events/migrations/0002_auto_20200722_0101.py | 23 ------------- .../migrations/0002_eventregistration_user.py | 23 +++++++++++++ users/migrations/0001_initial.py | 4 +-- users/migrations/0002_auto_20200721_2249.py | 18 ----------- 5 files changed, 57 insertions(+), 43 deletions(-) create mode 100644 events/migrations/0001_initial.py delete mode 100644 events/migrations/0002_auto_20200722_0101.py create mode 100644 events/migrations/0002_eventregistration_user.py delete mode 100644 users/migrations/0002_auto_20200721_2249.py diff --git a/events/migrations/0001_initial.py b/events/migrations/0001_initial.py new file mode 100644 index 0000000..a1a14dd --- /dev/null +++ b/events/migrations/0001_initial.py @@ -0,0 +1,32 @@ +# Generated by Django 3.0.8 on 2020-07-22 02:18 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Event', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateField()), + ('time', models.IntegerField(choices=[(0, 'Voormiddag'), (1, 'Namiddag'), (2, 'Avond')], default=0)), + ('capacity', models.IntegerField(default=6)), + ], + ), + migrations.CreateModel( + name='EventRegistration', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('state', models.CharField(choices=[('I', 'Interested'), ('A', 'Admitted'), ('D', 'Denied')], max_length=1)), + ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Event')), + ], + ), + ] diff --git a/events/migrations/0002_auto_20200722_0101.py b/events/migrations/0002_auto_20200722_0101.py deleted file mode 100644 index ab3ddbc..0000000 --- a/events/migrations/0002_auto_20200722_0101.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-22 01:01 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('events', '0001_initial'), - ] - - operations = [ - migrations.RenameField( - model_name='eventregistration', - old_name='event_id', - new_name='event', - ), - migrations.RenameField( - model_name='eventregistration', - old_name='user_id', - new_name='user', - ), - ] diff --git a/events/migrations/0002_eventregistration_user.py b/events/migrations/0002_eventregistration_user.py new file mode 100644 index 0000000..005ac0a --- /dev/null +++ b/events/migrations/0002_eventregistration_user.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.8 on 2020-07-22 02:18 + +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), + ), + ] diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py index b68ad10..a5be237 100644 --- a/users/migrations/0001_initial.py +++ b/users/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.8 on 2020-07-21 22:48 +# Generated by Django 3.0.8 on 2020-07-22 02:18 from django.db import migrations, models import django.utils.timezone @@ -20,7 +20,7 @@ class Migration(migrations.Migration): ('password', models.CharField(max_length=128, verbose_name='password')), ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), - ('zeus_id', models.IntegerField()), + ('zeus_id', models.IntegerField(null=True, unique=True)), ('is_staff', models.BooleanField(default=False)), ('username', models.CharField(max_length=50, unique=True)), ('student_number', models.CharField(max_length=255)), diff --git a/users/migrations/0002_auto_20200721_2249.py b/users/migrations/0002_auto_20200721_2249.py deleted file mode 100644 index 2d53721..0000000 --- a/users/migrations/0002_auto_20200721_2249.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-21 22:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('users', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='customuser', - name='zeus_id', - field=models.IntegerField(null=True, unique=True), - ), - ]