# Generated by Django 2.1.3 on 2019-01-01 13:50

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ElementType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('key', models.CharField(max_length=30)),
                ('options', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
            ],
        ),
        migrations.CreateModel(
            name='FeedbackCollection',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FeedbackData',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('value', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('collection', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.FeedbackCollection')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FeedbackForm',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=250)),
                ('key', models.CharField(blank=True, max_length=32, null=True, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FormElement',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=250)),
                ('label', models.CharField(blank=True, max_length=1000, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('options', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict)),
                ('order', models.SmallIntegerField(default=0)),
                ('element_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.ElementType')),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.FeedbackForm')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Placement',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('id', models.CharField(max_length=64, primary_key=True, serialize=False)),
                ('name', models.CharField(blank=True, max_length=250, null=True)),
                ('url', models.URLField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='feedbackdata',
            name='element',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.FormElement'),
        ),
        migrations.AddField(
            model_name='feedbackcollection',
            name='form',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.FeedbackForm'),
        ),
        migrations.AddField(
            model_name='feedbackcollection',
            name='placement',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='feedback.Placement'),
        ),
    ]
