# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-26 12:21
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Candidate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('firstname', models.CharField(max_length=20)),
                ('secondname', models.CharField(max_length=20)),
                ('surname', models.CharField(max_length=40)),
            ],
        ),
        migrations.CreateModel(
            name='Circuit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('no', models.PositiveIntegerField()),
                ('address', models.CharField(max_length=300)),
                ('entitled', models.PositiveIntegerField()),
                ('cards', models.PositiveIntegerField()),
                ('votes', models.PositiveIntegerField()),
                ('valid', models.PositiveIntegerField()),
                ('invalid', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Commune',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('code', models.CharField(max_length=5, unique=True)),
                ('entitled', models.PositiveIntegerField()),
                ('cards', models.PositiveIntegerField()),
                ('votes', models.PositiveIntegerField()),
                ('valid', models.PositiveIntegerField()),
                ('invalid', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('entitled', models.PositiveIntegerField()),
                ('cards', models.PositiveIntegerField()),
                ('votes', models.PositiveIntegerField()),
                ('valid', models.PositiveIntegerField()),
                ('invalid', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('no', models.PositiveIntegerField(unique=True)),
                ('name', models.CharField(max_length=50)),
                ('entitled', models.PositiveIntegerField()),
                ('cards', models.PositiveIntegerField()),
                ('votes', models.PositiveIntegerField()),
                ('valid', models.PositiveIntegerField()),
                ('invalid', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Voivodeship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('no', models.PositiveIntegerField(unique=True)),
                ('name', models.CharField(max_length=50)),
                ('entitled', models.PositiveIntegerField()),
                ('cards', models.PositiveIntegerField()),
                ('votes', models.PositiveIntegerField()),
                ('valid', models.PositiveIntegerField()),
                ('invalid', models.PositiveIntegerField()),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subareas', to='election.Country')),
            ],
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.PositiveIntegerField()),
                ('candidate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='election.Candidate')),
                ('circuit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='election.Circuit')),
            ],
        ),
        migrations.AddField(
            model_name='district',
            name='voivodeship',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subareas', to='election.Voivodeship'),
        ),
        migrations.AddField(
            model_name='commune',
            name='district',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subareas', to='election.District'),
        ),
        migrations.AddField(
            model_name='circuit',
            name='commune',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subareas', to='election.Commune'),
        ),
        migrations.AlterUniqueTogether(
            name='vote',
            unique_together=set([('candidate', 'circuit')]),
        ),
    ]
