# Generated by Django 2.2 on 2019-04-30 20:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import formMaker.helpers
import main.helpers


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AnonymousUser',
            fields=[
                ('uuid', models.CharField(default=formMaker.helpers.generate_hash, max_length=10, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.CharField(default=formMaker.helpers.generate_hash, max_length=10)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('UNIQUE_ANSWER', 'unique answer'), ('MULTIPLE_ANSWER', 'multiple_answer'), ('TEXT', 'text'), ('HTML', 'html'), ('FILE', 'file')], max_length=100)),
                ('text', models.CharField(max_length=500)),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Form')),
            ],
        ),
        migrations.CreateModel(
            name='PossibleAnswer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=500)),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Question')),
            ],
        ),
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(blank=True, null=True)),
                ('isHtml', models.BooleanField(default=False)),
                ('file', models.FileField(blank=True, null=True, upload_to=main.helpers.build_filename_with_hash)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.AnonymousUser')),
                ('chosenAnswer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='main.PossibleAnswer')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Question')),
            ],
        ),
    ]
