# Generated by Django 3.2.7 on 2021-09-24 00:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Option',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('oid', models.UUIDField(default=uuid.uuid4)),
                ('text', models.CharField(max_length=200)),
                ('position', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qid', models.UUIDField(default=uuid.uuid4)),
                ('source_id', models.IntegerField()),
                ('text', models.TextField(max_length=100)),
                ('position', models.IntegerField()),
                ('correct_option', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='correctly_answers', to='survey_api.option')),
                ('submitted_option', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='submitted_for', to='survey_api.option')),
            ],
        ),
        migrations.CreateModel(
            name='SurveyUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=100)),
                ('last_name', models.CharField(max_length=100)),
                ('email', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('survey_id', models.UUIDField(default=uuid.uuid4)),
                ('start_time', models.DateTimeField(auto_now=True)),
                ('duration', models.DurationField(default=datetime.timedelta(seconds=3600))),
                ('length', models.IntegerField()),
                ('next_question', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='survey_next_in', to='survey_api.question')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='survey_api.surveyuser')),
            ],
        ),
        migrations.AddField(
            model_name='question',
            name='survey',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='survey_api.survey'),
        ),
        migrations.AddField(
            model_name='option',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='survey_api.question'),
        ),
        migrations.AddField(
            model_name='option',
            name='survey',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='survey_api.survey'),
        ),
    ]
