From c8c3852323d355bb0810c8621f9c6bf6b357427b Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 27 Sep 2020 20:34:39 +0200 Subject: [PATCH] Added basic (empty) 3-way migration. --- .../lostplaces/migrations/0002_temp_create.py | 90 +++++++++++++++++++ .../migrations/0003_migrate_data.py | 13 +++ .../migrations/0004_alter_fields_back.py | 36 ++++++++ 3 files changed, 139 insertions(+) create mode 100644 django_lostplaces/lostplaces/migrations/0002_temp_create.py create mode 100644 django_lostplaces/lostplaces/migrations/0003_migrate_data.py create mode 100644 django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py diff --git a/django_lostplaces/lostplaces/migrations/0002_temp_create.py b/django_lostplaces/lostplaces/migrations/0002_temp_create.py new file mode 100644 index 0000000..5988c66 --- /dev/null +++ b/django_lostplaces/lostplaces/migrations/0002_temp_create.py @@ -0,0 +1,90 @@ +# Generated by Django 3.1.1 on 2020-09-27 17:39 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('lostplaces', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Expireable', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_when', models.DateTimeField(auto_now_add=True)), + ('expires_when', models.DateTimeField()), + ], + ), + migrations.RemoveField( + model_name='photoalbum', + name='externallink_ptr', + ), + migrations.RemoveField( + model_name='voucher', + name='created_when', + ), + migrations.RemoveField( + model_name='voucher', + name='expires_when', + ), + migrations.RemoveField( + model_name='voucher', + name='id', + ), + migrations.AddField( + model_name='photoalbum', + name='id', + field=models.AutoField(auto_created=True, null=True, primary_key=True, serialize=False, verbose_name='ID'), + preserve_default=False, + ), + migrations.AddField( + model_name='photoalbum', + name='label', + field=models.CharField(null=True, max_length=100), + preserve_default=False, + ), + migrations.AddField( + model_name='photoalbum', + name='submitted_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='photoalbums', to='lostplaces.explorer'), + ), + migrations.AddField( + model_name='photoalbum', + name='submitted_when', + field=models.DateTimeField(auto_now_add=True, null=True), + ), + migrations.AddField( + model_name='photoalbum', + name='url', + field=models.URLField(null=True), + preserve_default=False, + ), + migrations.AlterField( + model_name='photoalbum', + name='place', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='photoalbums', to='lostplaces.place'), + ), + migrations.AlterField( + model_name='place', + name='submitted_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='places', to='lostplaces.explorer'), + ), + migrations.AlterField( + model_name='placeimage', + name='submitted_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimages', to='lostplaces.explorer'), + ), + migrations.DeleteModel( + name='ExternalLink', + ), + migrations.AddField( + model_name='voucher', + name='expireable_ptr', + field=models.OneToOneField(auto_created=True, null=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='lostplaces.expireable'), + preserve_default=False, + ), + ] diff --git a/django_lostplaces/lostplaces/migrations/0003_migrate_data.py b/django_lostplaces/lostplaces/migrations/0003_migrate_data.py new file mode 100644 index 0000000..bf1ab08 --- /dev/null +++ b/django_lostplaces/lostplaces/migrations/0003_migrate_data.py @@ -0,0 +1,13 @@ +# Generated by Django 3.1.1 on 2020-09-27 17:40 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('lostplaces', '0002_auto_20200927_1739'), + ] + + operations = [ + ] diff --git a/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py b/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py new file mode 100644 index 0000000..b8e5513 --- /dev/null +++ b/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py @@ -0,0 +1,36 @@ +# Generated by Django 3.1.1 on 2020-09-27 17:40 + +from django.db import migrations, models + +class Migration(migrations.Migration): + + dependencies = [ + ('lostplaces', '0003_auto_20200927_1740'), + ] + + operations = [ + migrations.AlterField( + model_name='voucher', + name='expireable_ptr', + field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='lostplaces.expireable'), + preserve_default=False, + ), + migrations.AlterField( + model_name='photoalbum', + name='url', + field=models.URLField(), + preserve_default=False, + ), + migrations.AlterField( + model_name='photoalbum', + name='label', + field=models.CharField(max_length=100), + preserve_default=False, + ), + migrations.AlterField( + model_name='photoalbum', + name='id', + field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + preserve_default=False, + ), + ]