From 410905f3ced528a8be59bb13f3cbe69b99440244 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sat, 19 Aug 2017 21:33:13 +0200 Subject: [PATCH] redo migrations completely --- .../migrations/0048_product_ticket_type.py | 2 +- src/tickets/migrations/0001_initial.py | 40 +++---- .../migrations/0002_auto_20170819_2126.py | 108 ------------------ .../migrations/0003_auto_20170819_2126.py | 21 ---- 4 files changed, 17 insertions(+), 154 deletions(-) delete mode 100644 src/tickets/migrations/0002_auto_20170819_2126.py delete mode 100644 src/tickets/migrations/0003_auto_20170819_2126.py diff --git a/src/shop/migrations/0048_product_ticket_type.py b/src/shop/migrations/0048_product_ticket_type.py index 97c36ff6..a9b9ae5f 100644 --- a/src/shop/migrations/0048_product_ticket_type.py +++ b/src/shop/migrations/0048_product_ticket_type.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-08-17 14:22 +# Generated by Django 1.10.5 on 2017-08-19 19:32 from __future__ import unicode_literals from django.db import migrations, models diff --git a/src/tickets/migrations/0001_initial.py b/src/tickets/migrations/0001_initial.py index bd4e36b5..7c59deaa 100644 --- a/src/tickets/migrations/0001_initial.py +++ b/src/tickets/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-08-17 14:22 +# Generated by Django 1.10.5 on 2017-08-19 19:32 from __future__ import unicode_literals from django.db import migrations, models @@ -13,17 +13,23 @@ class Migration(migrations.Migration): dependencies = [ ('shop', '0047_auto_20170522_1942'), - ('camps', '0022_camp_colour'), ('sponsors', '0006_auto_20170715_1110'), + ('camps', '0022_camp_colour'), ] operations = [ migrations.CreateModel( name='BaseTicket', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), ('qrcode_base64', models.TextField(blank=True, null=True)), + ('checked_in', models.BooleanField(default=False)), ], + options={ + 'abstract': False, + }, ), migrations.CreateModel( name='TicketType', @@ -32,6 +38,7 @@ class Migration(migrations.Migration): ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('name', models.TextField()), + ('camp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='camps.Camp')), ], options={ 'abstract': False, @@ -40,53 +47,38 @@ class Migration(migrations.Migration): migrations.CreateModel( name='DiscountTicket', fields=[ - ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='tickets.BaseTicket')), - ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), + ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket')), ('price', models.IntegerField(help_text='Price of the discounted ticket (in DKK, including VAT).')), ], options={ 'abstract': False, }, - bases=('tickets.baseticket', models.Model), + bases=('tickets.baseticket',), ), migrations.CreateModel( name='ShopTicket', fields=[ - ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='tickets.BaseTicket')), - ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), + ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket')), ('name', models.CharField(blank=True, help_text='Name of the person this ticket belongs to. This can be different from the buying user.', max_length=100, null=True)), ('email', models.EmailField(blank=True, max_length=254, null=True)), - ('checked_in', models.BooleanField(default=False)), ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='shoptickets', to='shop.Order')), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='shop.Product')), ], options={ 'abstract': False, }, - bases=('tickets.baseticket', models.Model), + bases=('tickets.baseticket',), ), migrations.CreateModel( name='SponsorTicket', fields=[ - ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='tickets.BaseTicket')), - ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), + ('baseticket_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket')), ('sponsor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sponsors.Sponsor')), ], options={ 'abstract': False, }, - bases=('tickets.baseticket', models.Model), - ), - migrations.AddField( - model_name='baseticket', - name='camp', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='camps.Camp'), + bases=('tickets.baseticket',), ), migrations.AddField( model_name='baseticket', diff --git a/src/tickets/migrations/0002_auto_20170819_2126.py b/src/tickets/migrations/0002_auto_20170819_2126.py deleted file mode 100644 index ccebdb12..00000000 --- a/src/tickets/migrations/0002_auto_20170819_2126.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-08-19 19:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('camps', '0022_camp_colour'), - ('tickets', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='baseticket', - name='camp', - ), - migrations.RemoveField( - model_name='baseticket', - name='id', - ), - migrations.RemoveField( - model_name='discountticket', - name='created', - ), - migrations.RemoveField( - model_name='discountticket', - name='updated', - ), - migrations.RemoveField( - model_name='discountticket', - name='uuid', - ), - migrations.RemoveField( - model_name='shopticket', - name='checked_in', - ), - migrations.RemoveField( - model_name='shopticket', - name='created', - ), - migrations.RemoveField( - model_name='shopticket', - name='updated', - ), - migrations.RemoveField( - model_name='shopticket', - name='uuid', - ), - migrations.RemoveField( - model_name='sponsorticket', - name='created', - ), - migrations.RemoveField( - model_name='sponsorticket', - name='updated', - ), - migrations.RemoveField( - model_name='sponsorticket', - name='uuid', - ), - migrations.AddField( - model_name='baseticket', - name='checked_in', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='baseticket', - name='created', - field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), - preserve_default=False, - ), - migrations.AddField( - model_name='baseticket', - name='updated', - field=models.DateTimeField(auto_now=True), - ), - migrations.AddField( - model_name='baseticket', - name='uuid', - field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - migrations.AddField( - model_name='tickettype', - name='camp', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='camps.Camp'), - ), - migrations.AlterField( - model_name='discountticket', - name='baseticket_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket'), - ), - migrations.AlterField( - model_name='shopticket', - name='baseticket_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket'), - ), - migrations.AlterField( - model_name='sponsorticket', - name='baseticket_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tickets.BaseTicket'), - ), - ] diff --git a/src/tickets/migrations/0003_auto_20170819_2126.py b/src/tickets/migrations/0003_auto_20170819_2126.py deleted file mode 100644 index 6b1bad2e..00000000 --- a/src/tickets/migrations/0003_auto_20170819_2126.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-08-19 19:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('tickets', '0002_auto_20170819_2126'), - ] - - operations = [ - migrations.AlterField( - model_name='tickettype', - name='camp', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='camps.Camp'), - ), - ]