# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-12-15 15:35
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('email', models.EmailField(max_length=254)),
                ('text', models.CharField(max_length=5000, validators=[django.core.validators.MinLengthValidator(5)])),
            ],
        ),
        migrations.CreateModel(
            name='GistsConfiguration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('target_branch_depth', models.PositiveIntegerField(default=8, validators=[django.core.validators.MinValueValidator(2)])),
                ('target_branch_count', models.PositiveIntegerField(default=6, validators=[django.core.validators.MinValueValidator(1)])),
                ('branch_probability', models.FloatField(default=0.2, validators=[django.core.validators.MinValueValidator(0.1)])),
                ('read_factor', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])),
                ('write_factor', models.PositiveIntegerField(default=5, validators=[django.core.validators.MinValueValidator(1)])),
                ('min_tokens', models.PositiveIntegerField(default=10, validators=[django.core.validators.MinValueValidator(1)])),
                ('pause_period', models.PositiveIntegerField(default=10, validators=[django.core.validators.MinValueValidator(1)])),
                ('experiment_work', models.PositiveIntegerField(default=50, validators=[django.core.validators.MinValueValidator(1)])),
                ('training_work', models.PositiveIntegerField(default=5, validators=[django.core.validators.MinValueValidator(1)])),
                ('base_credit', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Gists Configuration',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('mothertongue', models.CharField(choices=[('english', 'English'), ('other', 'Other')], max_length=100)),
                ('trained_reformulations', models.BooleanField(default=False)),
                ('introduced_exp_home', models.BooleanField(default=False)),
                ('introduced_exp_play', models.BooleanField(default=False)),
                ('introduced_play_home', models.BooleanField(default=False)),
                ('introduced_play_play', models.BooleanField(default=False)),
                ('prolific_id', models.CharField(max_length=50, null=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Questionnaire',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('age', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(3), django.core.validators.MaxValueValidator(120)])),
                ('gender', models.CharField(choices=[('female', 'Female'), ('male', 'Male'), ('other', 'Other')], max_length=100)),
                ('informed', models.BooleanField(default=False)),
                ('informed_how', models.CharField(max_length=500, validators=[django.core.validators.MinLengthValidator(5)])),
                ('informed_what', models.CharField(max_length=500, validators=[django.core.validators.MinLengthValidator(5)])),
                ('education_level', models.CharField(choices=[('1', 'No schooling'), ('2', 'Incomplete primary'), ('3', 'Primary'), ('4', 'Lower secondary'), ('5', 'Upper secondary'), ('6', 'Post-secondary non-tertiary'), ('7', 'Short-cycle tertiary'), ('8', "Bachelor's or equivalent"), ('9', "Master's or equivalent"), ('10', 'Doctoral or equivalent'), ('-', 'Other')], max_length=5)),
                ('education_freetext', models.CharField(max_length=500, validators=[django.core.validators.MinLengthValidator(5)])),
                ('job_type', models.CharField(choices=[('1', 'Student'), ('2', 'Manager'), ('3', 'Professional'), ('4', 'Technician or associate professional'), ('5', 'Clerical support worker'), ('6', 'Service or sales worker'), ('7', 'Skilled agricultural, forestry or fishery worker'), ('8', 'Craft or related trades worker'), ('9', 'Plant and machine operator, or assembler'), ('10', 'Elementary occupations'), ('11', 'Army'), ('-', 'Other')], max_length=5)),
                ('job_freetext', models.CharField(max_length=500, validators=[django.core.validators.MinLengthValidator(5)])),
                ('profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='gists.Profile')),
            ],
        ),
        migrations.CreateModel(
            name='Sentence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('text', models.CharField(max_length=5000)),
                ('read_time_proportion', models.FloatField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])),
                ('read_time_allotted', models.FloatField(validators=[django.core.validators.MinValueValidator(0)])),
                ('write_time_proportion', models.FloatField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])),
                ('write_time_allotted', models.FloatField(validators=[django.core.validators.MinValueValidator(0)])),
                ('language', models.CharField(choices=[('english', 'English'), ('other', 'Other')], max_length=100)),
                ('bucket', models.CharField(choices=[('experiment', 'Experiment'), ('game', 'Game'), ('training', 'Training')], max_length=100)),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='gists.Sentence')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sentences', to='gists.Profile')),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Tree',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('profiles', models.ManyToManyField(related_name='trees', through='gists.Sentence', to='gists.Profile')),
            ],
        ),
        migrations.CreateModel(
            name='WordSpan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('span', models.PositiveSmallIntegerField()),
                ('score', models.PositiveSmallIntegerField()),
                ('profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='word_span', to='gists.Profile')),
            ],
        ),
        migrations.AddField(
            model_name='sentence',
            name='tree',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sentences', to='gists.Tree'),
        ),
        migrations.AddField(
            model_name='sentence',
            name='tree_as_root',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='root', to='gists.Tree'),
        ),
        migrations.AddField(
            model_name='comment',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='gists.Profile'),
        ),
    ]
