From 8d9ab8b0880be81a4e117691669ca0bc2511b1f7 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 27 Sep 2020 20:33:56 +0200 Subject: [PATCH] Add migrations back into repo - preparation for release. --- .gitignore | 6 -- .../lostplaces/migrations/0001_initial.py | 87 +++++++++++++++++++ .../lostplaces/migrations/__init__.py | 0 3 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 django_lostplaces/lostplaces/migrations/0001_initial.py create mode 100644 django_lostplaces/lostplaces/migrations/__init__.py diff --git a/.gitignore b/.gitignore index f32b3ab..8abb87e 100644 --- a/.gitignore +++ b/.gitignore @@ -65,12 +65,6 @@ coverage.xml # Translations *.mo -# Django stuff: -# exclude migrations from repository. These should be created locally, matching local DB requirements. -# lostplaces/manage.py makemigrations && lostplaces/manage.py migrate - -django_lostplaces/lostplaces/migrations/ - # pyenv .python-version diff --git a/django_lostplaces/lostplaces/migrations/0001_initial.py b/django_lostplaces/lostplaces/migrations/0001_initial.py new file mode 100644 index 0000000..ba1b8f6 --- /dev/null +++ b/django_lostplaces/lostplaces/migrations/0001_initial.py @@ -0,0 +1,87 @@ +# Generated by Django 3.1.1 on 2020-09-17 18:05 + +from django.conf import settings +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import easy_thumbnails.fields +import lostplaces.models +import taggit.managers + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('taggit', '0003_taggeditem_add_unique_index'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Explorer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='explorer', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='ExternalLink', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('url', models.URLField()), + ('label', models.CharField(max_length=100)), + ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='external_links', to='lostplaces.explorer')), + ], + ), + migrations.CreateModel( + name='Place', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=50)), + ('latitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)])), + ('longitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])), + ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), + ('location', models.CharField(max_length=50)), + ('description', models.TextField()), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='place', to='lostplaces.explorer')), + ('tags', taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='Voucher', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('code', models.CharField(max_length=30, unique=True)), + ('created_when', models.DateTimeField(auto_now_add=True)), + ('expires_when', models.DateTimeField()), + ], + ), + migrations.CreateModel( + name='PlaceImage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), + ('description', models.TextField(blank=True)), + ('filename', easy_thumbnails.fields.ThumbnailerImageField(upload_to=lostplaces.models.generate_image_upload_path)), + ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='placeimages', to='lostplaces.place')), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimage', to='lostplaces.explorer')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='PhotoAlbum', + fields=[ + ('externallink_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='lostplaces.externallink')), + ('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='photo_albums', to='lostplaces.place')), + ], + bases=('lostplaces.externallink',), + ), + ] diff --git a/django_lostplaces/lostplaces/migrations/__init__.py b/django_lostplaces/lostplaces/migrations/__init__.py new file mode 100644 index 0000000..e69de29