# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-02 14:11
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    replaces = [('dj_experiment', '0001_initial'), ('dj_experiment', '0002_auto_20170802_0612'), ('dj_experiment', '0003_auto_20170802_1118'), ('dj_experiment', '0004_auto_20170802_0644'), ('dj_experiment', '0005_auto_20170802_1144'), ('dj_experiment', '0006_auto_20170802_0904')]

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BaseModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('title', models.CharField(max_length=255, verbose_name='title')),
                ('description', models.TextField(blank=True, null=True, verbose_name='description')),
                ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from=b'title', verbose_name='slug')),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
        ),
        migrations.CreateModel(
            name='Value',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('val', models.CharField(max_length=100)),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
        ),
        migrations.CreateModel(
            name='Case',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='dj_experiment.BaseModel')),
                ('shortname', models.CharField(max_length=10)),
                ('longname', models.CharField(max_length=100)),
                ('casevals', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cases', to='dj_experiment.Value')),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
            bases=('dj_experiment.basemodel',),
        ),
        migrations.CreateModel(
            name='Catalog',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='dj_experiment.BaseModel')),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
            bases=('dj_experiment.basemodel',),
        ),
        migrations.CreateModel(
            name='Experiment',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='dj_experiment.BaseModel')),
                ('name', models.CharField(max_length=100)),
                ('timeseries', models.BooleanField(default=False)),
                ('data_dir', models.CharField(default=b'./', max_length=250)),
                ('separator', models.CharField(default=b'.', max_length=1)),
                ('case_path', models.CharField(default=None, max_length=100)),
                ('initial_position', models.BooleanField(default=False)),
                ('output_prefix', models.CharField(default=b'', max_length=100)),
                ('output_suffix', models.CharField(default=b'.nc', max_length=100)),
                ('validate_data', models.BooleanField(default=True)),
                ('cases', models.ManyToManyField(related_name='experiments', to=b'dj_experiment.Case', verbose_name=b'Esperiment cases')),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
            bases=('dj_experiment.basemodel',),
        ),
        migrations.CreateModel(
            name='FieldGroup',
            fields=[
                ('basemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='dj_experiment.BaseModel')),
                ('shortname', models.CharField(max_length=50)),
                ('longname', models.CharField(max_length=100)),
                ('is_initialposition', models.BooleanField(default=False)),
                ('fieldnames', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fieldgroups', to='dj_experiment.Value')),
            ],
            options={
                'ordering': ('-modified', '-created'),
                'abstract': False,
                'get_latest_by': 'modified',
            },
            bases=('dj_experiment.basemodel',),
        ),
        migrations.AddField(
            model_name='experiment',
            name='fieldgroups',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiments', to='dj_experiment.FieldGroup'),
        ),
        migrations.AddField(
            model_name='catalog',
            name='xperiment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiments', to='dj_experiment.Experiment'),
        ),
        migrations.AlterField(
            model_name='case',
            name='shortname',
            field=models.CharField(max_length=50),
        ),
        migrations.AlterField(
            model_name='experiment',
            name='data_dir',
            field=models.CharField(default=b'RCM data', max_length=250),
        ),
        migrations.AlterField(
            model_name='experiment',
            name='separator',
            field=models.CharField(default=b'_', max_length=1),
        ),
    ]
