# Generated by Django 2.2.10 on 2021-10-18 10:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Poll',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=256)),
                ('description', models.TextField()),
                ('begin_date', models.DateTimeField()),
                ('finish_date', models.DateTimeField()),
            ],
            options={
                'ordering': ['begin_date'],
            },
        ),
        migrations.CreateModel(
            name='Poll_Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('answer_type', models.CharField(choices=[('TX', 'text answer'), ('RD', 'single choice'), ('CH', 'multiple choices')], max_length=2)),
                ('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Poll')),
            ],
            options={
                'ordering': ['poll', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Poll_Answer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.CharField(max_length=10)),
                ('text', models.CharField(max_length=1024)),
                ('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Poll')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Poll_Question')),
            ],
        ),
    ]
