# Generated by Django 2.1.5 on 2019-04-05 03:51

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


class Migration(migrations.Migration):

    dependencies = [
        ('common', '0005_us_aqi_index_tables_data'),
    ]

    operations = [
        migrations.CreateModel(
            name='Pollutant',
            fields=[
                ('abbreviation', models.CharField(max_length=5, primary_key=True, serialize=False, verbose_name='Abbrevation')),
                ('name', models.CharField(blank=True, max_length=63, null=True, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Pollutant',
                'verbose_name_plural': 'Pollutants',
                'db_table': 'pollutant',
            },
        ),
        migrations.CreateModel(
            name='ProfileAnswerPollutantIndex',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('index', models.FloatField(default=0.0, verbose_name='Health Influence Index')),
            ],
        ),
        migrations.CreateModel(
            name='ProfileQuestion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveSmallIntegerField(blank=True, null=True, unique=True, verbose_name='Order')),
                ('text', ckeditor.fields.RichTextField(verbose_name='Question Text')),
                ('active', models.BooleanField(default=True, verbose_name='Is Active')),
            ],
            options={
                'verbose_name': 'Profile Question',
                'verbose_name_plural': 'Profile Questions',
                'db_table': 'profile_question',
                'ordering': ('order',),
            },
        ),
        migrations.CreateModel(
            name='ProfileQuestionAnswer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', ckeditor.fields.RichTextField(verbose_name='Answer Text')),
                ('order', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Order')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='common.ProfileQuestion', verbose_name='Profile Question')),
            ],
            options={
                'verbose_name': 'Profile Question Answer',
                'verbose_name_plural': 'Profile Question Answers',
                'db_table': 'profile_q_answer',
                'ordering': ('question__order', 'order',),
            },
        ),
        migrations.AlterField(
            model_name='aqicategorythreshold',
            name='abbreviation',
            field=models.CharField(max_length=2, verbose_name='Abbrevation'),
        ),
        migrations.AddField(
            model_name='profileanswerpollutantindex',
            name='answer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='indexes', to='common.ProfileQuestionAnswer', verbose_name='Answer'),
        ),
        migrations.AddField(
            model_name='profileanswerpollutantindex',
            name='pollutant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='indexes', to='common.Pollutant', verbose_name='Pollutant'),
        ),
        migrations.AlterUniqueTogether(
            name='profilequestionanswer',
            unique_together={('question', 'order')},
        ),
    ]
