# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-28 20:57
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='Choice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.CharField(max_length=255, verbose_name='Ответ')),
                ('vote_count', models.PositiveIntegerField(default=0, editable=False, verbose_name='Количество проголосовавших')),
            ],
            options={
                'verbose_name': 'Ответ',
                'ordering': ('-pk',),
                'verbose_name_plural': 'Ответы',
            },
        ),
        migrations.CreateModel(
            name='Poll',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('question', models.CharField(max_length=255, verbose_name='Вопрос')),
                ('sum_votes', models.PositiveIntegerField(default=0, editable=False, verbose_name='Всего голосов')),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name': 'Опрос',
                'ordering': ('-pk',),
                'verbose_name_plural': 'Опросы',
            },
        ),
        migrations.AddField(
            model_name='choice',
            name='poll',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Poll', verbose_name='Опрос'),
        ),
    ]
