# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-14 22:03
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields.json
import users.models
import utils.html


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('email_subject', models.CharField(max_length=250, verbose_name='email subject')),
                ('email_content', utils.html.HTMLField(blank=True, null=True, verbose_name='email content')),
                ('q13e', models.TextField()),
            ],
            options={
                'verbose_name': 'survey',
                'verbose_name_plural': 'surveys',
            },
        ),
        migrations.CreateModel(
            name='SurveyAnswer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(default=users.models.generate_code)),
                ('answered_at', models.DateTimeField(blank=True, null=True)),
                ('is_open', models.BooleanField(db_index=True, default=True, verbose_name='open')),
                ('data', django_extensions.db.fields.json.JSONField(blank=True, default=dict, null=True)),
                ('survey', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='surveys.Survey')),
            ],
            options={
                'verbose_name': 'survey answer',
                'verbose_name_plural': 'survey answers',
                'ordering': ('-is_open', '-answered_at', '-created_at'),
            },
        ),
    ]
