# Generated by Django 2.2 on 2019-04-18 23:04

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),
        ('diafo', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=500)),
                ('description', models.TextField(max_length=2000)),
                ('phase', models.CharField(choices=[('IP', 'Initial Phase'), ('NP', 'Nomination Phase'), ('CP', 'Campaign Phase'), ('PP', 'Polling Phase'), ('OPP', 'Offline Polling Phase'), ('MP', 'Mid Phase'), ('RP', 'Result Phase'), ('EP', 'End Phase')], default='IP', max_length=30)),
                ('batch', models.CharField(default='all', max_length=100)),
                ('nomination', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='diafo.Questionnaire')),
            ],
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('questionnaire', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='diafo.Questionnaire')),
            ],
        ),
        migrations.CreateModel(
            name='EntityVotecast',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='election.Entity')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='EntityCandidate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('readme', models.TextField(max_length=5000)),
                ('approval', models.BooleanField(default=True)),
                ('phase', models.CharField(default='IP', max_length=30)),
                ('votes', models.IntegerField(default=0)),
                ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='candidates', to='election.Entity')),
                ('response', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='diafo.FilledForm')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
