From 772a3b5827bf72497469f3082b142dedc1e00624 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Sun, 25 Dec 2016 22:09:59 +0100 Subject: [PATCH] Squashmigrations for elections --- election/migrations/0001_initial.py | 75 ----------- .../0001_squashed_0006_auto_20161223_2315.py | 117 ++++++++++++++++++ election/migrations/0002_role_max_choice.py | 19 --- .../migrations/0003_auto_20161219_1832.py | 35 ------ .../migrations/0004_auto_20161219_2302.py | 43 ------- .../migrations/0005_auto_20161223_2240.py | 70 ----------- .../migrations/0006_auto_20161223_2315.py | 25 ---- 7 files changed, 117 insertions(+), 267 deletions(-) delete mode 100644 election/migrations/0001_initial.py create mode 100644 election/migrations/0001_squashed_0006_auto_20161223_2315.py delete mode 100644 election/migrations/0002_role_max_choice.py delete mode 100644 election/migrations/0003_auto_20161219_1832.py delete mode 100644 election/migrations/0004_auto_20161219_2302.py delete mode 100644 election/migrations/0005_auto_20161223_2240.py delete mode 100644 election/migrations/0006_auto_20161223_2315.py diff --git a/election/migrations/0001_initial.py b/election/migrations/0001_initial.py deleted file mode 100644 index bb784252..00000000 --- a/election/migrations/0001_initial.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Candidature', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('program', models.TextField(blank=True, null=True, verbose_name='description')), - ], - ), - migrations.CreateModel( - name='Election', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('title', models.CharField(verbose_name='title', max_length=255)), - ('description', models.TextField(blank=True, null=True, verbose_name='description')), - ('start_candidature', models.DateTimeField(verbose_name='start candidature')), - ('end_candidature', models.DateTimeField(verbose_name='end candidature')), - ('start_date', models.DateTimeField(verbose_name='start date')), - ('end_date', models.DateTimeField(verbose_name='end date')), - ], - ), - migrations.CreateModel( - name='ElectionList', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('title', models.CharField(verbose_name='title', max_length=255)), - ('election', models.ForeignKey(related_name='election_list', verbose_name='election', to='election.Election')), - ], - ), - migrations.CreateModel( - name='Role', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('title', models.CharField(verbose_name='title', max_length=255)), - ('description', models.TextField(blank=True, null=True, verbose_name='description')), - ('election', models.ForeignKey(related_name='role', verbose_name='election', to='election.Election')), - ('has_voted', models.ManyToManyField(related_name='has_voted', to=settings.AUTH_USER_MODEL, verbose_name='has voted')), - ], - ), - migrations.CreateModel( - name='Vote', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('candidature', models.ManyToManyField(related_name='vote', to='election.Candidature', verbose_name='candidature')), - ('role', models.ForeignKey(related_name='vote', verbose_name='role', to='election.Role')), - ], - ), - migrations.AddField( - model_name='candidature', - name='election_list', - field=models.ForeignKey(related_name='candidature', verbose_name='election_list', to='election.ElectionList'), - ), - migrations.AddField( - model_name='candidature', - name='role', - field=models.ForeignKey(related_name='candidature', verbose_name='role', to='election.Role'), - ), - migrations.AddField( - model_name='candidature', - name='user', - field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='candidate', blank=True, verbose_name='user'), - ), - ] diff --git a/election/migrations/0001_squashed_0006_auto_20161223_2315.py b/election/migrations/0001_squashed_0006_auto_20161223_2315.py new file mode 100644 index 00000000..44c681ff --- /dev/null +++ b/election/migrations/0001_squashed_0006_auto_20161223_2315.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + replaces = [('election', '0001_initial'), ('election', '0002_role_max_choice'), ('election', '0003_auto_20161219_1832'), ('election', '0004_auto_20161219_2302'), ('election', '0005_auto_20161223_2240'), ('election', '0006_auto_20161223_2315')] + + dependencies = [ + ('core', '0016_auto_20161212_1922'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Candidature', + fields=[ + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), + ('program', models.TextField(null=True, verbose_name='description', blank=True)), + ], + ), + migrations.CreateModel( + name='Election', + fields=[ + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), + ('title', models.CharField(verbose_name='title', max_length=255)), + ('description', models.TextField(null=True, verbose_name='description', blank=True)), + ('start_candidature', models.DateTimeField(verbose_name='start candidature')), + ('end_candidature', models.DateTimeField(verbose_name='end candidature')), + ('start_date', models.DateTimeField(verbose_name='start date')), + ('end_date', models.DateTimeField(verbose_name='end date')), + ], + ), + migrations.CreateModel( + name='ElectionList', + fields=[ + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), + ('title', models.CharField(verbose_name='title', max_length=255)), + ('election', models.ForeignKey(related_name='election_lists', verbose_name='election', to='election.Election')), + ], + ), + migrations.CreateModel( + name='Role', + fields=[ + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), + ('title', models.CharField(verbose_name='title', max_length=255)), + ('description', models.TextField(null=True, verbose_name='description', blank=True)), + ('election', models.ForeignKey(related_name='role', verbose_name='election', to='election.Election')), + ('has_voted', models.ManyToManyField(related_name='has_voted', verbose_name='has voted', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Vote', + fields=[ + ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), + ('candidature', models.ManyToManyField(related_name='votes', verbose_name='candidature', to='election.Candidature')), + ('role', models.ForeignKey(related_name='votes', verbose_name='role', to='election.Role')), + ], + ), + migrations.AddField( + model_name='candidature', + name='election_list', + field=models.ForeignKey(related_name='candidatures', verbose_name='election_list', to='election.ElectionList'), + ), + migrations.AddField( + model_name='candidature', + name='role', + field=models.ForeignKey(related_name='candidatures', verbose_name='role', to='election.Role'), + ), + migrations.AddField( + model_name='candidature', + name='user', + field=models.ForeignKey(related_name='candidates', verbose_name='user', to=settings.AUTH_USER_MODEL, blank=True), + ), + migrations.AddField( + model_name='role', + name='max_choice', + field=models.IntegerField(default=1, verbose_name='max choice'), + ), + migrations.AddField( + model_name='election', + name='edit_groups', + field=models.ManyToManyField(related_name='editable_elections', verbose_name='edit groups', blank=True, to='core.Group'), + ), + migrations.AddField( + model_name='election', + name='view_groups', + field=models.ManyToManyField(related_name='viewable_elections', verbose_name='view groups', blank=True, to='core.Group'), + ), + migrations.AddField( + model_name='election', + name='candidature_groups', + field=models.ManyToManyField(related_name='candidate_elections', verbose_name='candidature groups', blank=True, to='core.Group'), + ), + migrations.AddField( + model_name='election', + name='vote_groups', + field=models.ManyToManyField(related_name='votable_elections', verbose_name='vote groups', blank=True, to='core.Group'), + ), + migrations.AlterField( + model_name='role', + name='election', + field=models.ForeignKey(related_name='roles', verbose_name='election', to='election.Election'), + ), + migrations.RemoveField( + model_name='role', + name='has_voted', + ), + migrations.AddField( + model_name='election', + name='voters', + field=models.ManyToManyField(related_name='has_voted', verbose_name='has voted', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/election/migrations/0002_role_max_choice.py b/election/migrations/0002_role_max_choice.py deleted file mode 100644 index ebce103d..00000000 --- a/election/migrations/0002_role_max_choice.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('election', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='role', - name='max_choice', - field=models.IntegerField(verbose_name='max choice', default=1), - ), - ] diff --git a/election/migrations/0003_auto_20161219_1832.py b/election/migrations/0003_auto_20161219_1832.py deleted file mode 100644 index 55c03808..00000000 --- a/election/migrations/0003_auto_20161219_1832.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0016_auto_20161212_1922'), - ('election', '0002_role_max_choice'), - ] - - operations = [ - migrations.AddField( - model_name='election', - name='candidature_group', - field=models.ManyToManyField(related_name='candidate_election', blank=True, verbose_name='candidature group', to='core.Group'), - ), - migrations.AddField( - model_name='election', - name='edit_groups', - field=models.ManyToManyField(related_name='editable_election', blank=True, verbose_name='edit group', to='core.Group'), - ), - migrations.AddField( - model_name='election', - name='view_groups', - field=models.ManyToManyField(related_name='viewable_election', blank=True, verbose_name='view group', to='core.Group'), - ), - migrations.AddField( - model_name='election', - name='vote_group', - field=models.ManyToManyField(related_name='votable_election', blank=True, verbose_name='vote group', to='core.Group'), - ), - ] diff --git a/election/migrations/0004_auto_20161219_2302.py b/election/migrations/0004_auto_20161219_2302.py deleted file mode 100644 index fabe3212..00000000 --- a/election/migrations/0004_auto_20161219_2302.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0016_auto_20161212_1922'), - ('election', '0003_auto_20161219_1832'), - ] - - operations = [ - migrations.RemoveField( - model_name='election', - name='candidature_group', - ), - migrations.RemoveField( - model_name='election', - name='vote_group', - ), - migrations.AddField( - model_name='election', - name='candidature_groups', - field=models.ManyToManyField(to='core.Group', verbose_name='candidature group', related_name='candidate_elections', blank=True), - ), - migrations.AddField( - model_name='election', - name='vote_groups', - field=models.ManyToManyField(to='core.Group', verbose_name='vote group', related_name='votable_elections', blank=True), - ), - migrations.AlterField( - model_name='election', - name='edit_groups', - field=models.ManyToManyField(to='core.Group', verbose_name='edit group', related_name='editable_elections', blank=True), - ), - migrations.AlterField( - model_name='election', - name='view_groups', - field=models.ManyToManyField(to='core.Group', verbose_name='view group', related_name='viewable_elections', blank=True), - ), - ] diff --git a/election/migrations/0005_auto_20161223_2240.py b/election/migrations/0005_auto_20161223_2240.py deleted file mode 100644 index 0538f465..00000000 --- a/election/migrations/0005_auto_20161223_2240.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - ('election', '0004_auto_20161219_2302'), - ] - - operations = [ - migrations.AlterField( - model_name='candidature', - name='election_list', - field=models.ForeignKey(related_name='candidatures', to='election.ElectionList', verbose_name='election_list'), - ), - migrations.AlterField( - model_name='candidature', - name='role', - field=models.ForeignKey(related_name='candidatures', to='election.Role', verbose_name='role'), - ), - migrations.AlterField( - model_name='candidature', - name='user', - field=models.ForeignKey(verbose_name='user', to=settings.AUTH_USER_MODEL, related_name='candidates', blank=True), - ), - migrations.AlterField( - model_name='election', - name='candidature_groups', - field=models.ManyToManyField(to='core.Group', related_name='candidate_elections', blank=True, verbose_name='candidature groups'), - ), - migrations.AlterField( - model_name='election', - name='edit_groups', - field=models.ManyToManyField(to='core.Group', related_name='editable_elections', blank=True, verbose_name='edit groups'), - ), - migrations.AlterField( - model_name='election', - name='view_groups', - field=models.ManyToManyField(to='core.Group', related_name='viewable_elections', blank=True, verbose_name='view groups'), - ), - migrations.AlterField( - model_name='election', - name='vote_groups', - field=models.ManyToManyField(to='core.Group', related_name='votable_elections', blank=True, verbose_name='vote groups'), - ), - migrations.AlterField( - model_name='electionlist', - name='election', - field=models.ForeignKey(related_name='election_lists', to='election.Election', verbose_name='election'), - ), - migrations.AlterField( - model_name='role', - name='election', - field=models.ForeignKey(related_name='roles', to='election.Election', verbose_name='election'), - ), - migrations.AlterField( - model_name='vote', - name='candidature', - field=models.ManyToManyField(to='election.Candidature', related_name='votes', verbose_name='candidature'), - ), - migrations.AlterField( - model_name='vote', - name='role', - field=models.ForeignKey(related_name='votes', to='election.Role', verbose_name='role'), - ), - ] diff --git a/election/migrations/0006_auto_20161223_2315.py b/election/migrations/0006_auto_20161223_2315.py deleted file mode 100644 index a6190ce5..00000000 --- a/election/migrations/0006_auto_20161223_2315.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('election', '0005_auto_20161223_2240'), - ] - - operations = [ - migrations.RemoveField( - model_name='role', - name='has_voted', - ), - migrations.AddField( - model_name='election', - name='voters', - field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='has voted', related_name='has_voted'), - ), - ]