# Generated by Django 2.1.2 on 2018-10-28 02:11

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('multiplicity', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='CSV',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(max_length=255)),
                ('original_name', models.CharField(max_length=255)),
                ('imported', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Data',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.FloatField(blank=True, null=True)),
                ('material_name', models.CharField(blank=True, max_length=500, null=True)),
                ('comments', models.TextField(blank=True, null=True)),
                ('csv', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.CSV')),
            ],
        ),
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('notes', models.TextField(blank=True, null=True)),
                ('replication', models.TextField(blank=True, null=True)),
                ('deleted', models.BooleanField(db_index=True, default=False)),
                ('access', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='access', to='multiplicity.DQIRating')),
                ('completeness', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='completeness', to='multiplicity.DQIRating')),
                ('geographical_correlation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='geographical_correlation', to='multiplicity.DQIRating')),
                ('graph', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.GraphType')),
                ('primary_space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multiplicity.ReferenceSpace')),
                ('references', models.ManyToManyField(to='core.Reference')),
                ('reliability', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reliability', to='multiplicity.DQIRating')),
                ('topics', models.ManyToManyField(to='multiplicity.Topic')),
                ('type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.DatasetType')),
            ],
        ),
        migrations.CreateModel(
            name='DatasetTimePeriod',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dataset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='staf.Dataset')),
            ],
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField(db_index=True)),
                ('code', models.CharField(blank=True, db_index=True, max_length=255, null=True)),
                ('is_separator', models.BooleanField()),
                ('description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='MaterialCatalog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Process',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_separator', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='ProcessType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='TimePeriod',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start', models.DateField(db_index=True)),
                ('end', models.DateField(blank=True, db_index=True, null=True)),
                ('name', models.CharField(db_index=True, max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('symbol', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=255)),
                ('notes', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='MaterialTree',
            fields=[
                ('node', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='tree_material', serialize=False, to='staf.Material')),
                ('ancestors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), size=None)),
            ],
            options={
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ProcessTree',
            fields=[
                ('node', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='tree_process', serialize=False, to='staf.Process')),
                ('ancestors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), size=None)),
            ],
            options={
                'managed': False,
            },
        ),
        migrations.AddField(
            model_name='process',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='staf.Process'),
        ),
        migrations.AddField(
            model_name='process',
            name='type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.ProcessType'),
        ),
        migrations.AddField(
            model_name='material',
            name='catalog',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.MaterialCatalog'),
        ),
        migrations.AddField(
            model_name='material',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='staf.Material'),
        ),
        migrations.AddField(
            model_name='datasettimeperiod',
            name='timeframe',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='staf.TimePeriod'),
        ),
        migrations.AddField(
            model_name='data',
            name='dataset',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='staf.Dataset'),
        ),
        migrations.AddField(
            model_name='data',
            name='destination',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='destination', to='staf.Process'),
        ),
        migrations.AddField(
            model_name='data',
            name='destination_space',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='destination_space', to='multiplicity.ReferenceSpace'),
        ),
        migrations.AddField(
            model_name='data',
            name='material',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.Material'),
        ),
        migrations.AddField(
            model_name='data',
            name='origin',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='origin', to='staf.Process'),
        ),
        migrations.AddField(
            model_name='data',
            name='origin_space',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='origin_space', to='multiplicity.ReferenceSpace'),
        ),
        migrations.AddField(
            model_name='data',
            name='subset',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.Data'),
        ),
        migrations.AddField(
            model_name='data',
            name='timeframe',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='staf.TimePeriod'),
        ),
        migrations.AddField(
            model_name='data',
            name='unit',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.Unit'),
        ),
        migrations.AddField(
            model_name='csv',
            name='dataset',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='staf.Dataset'),
        ),
        migrations.AddField(
            model_name='csv',
            name='datasettype',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.DatasetType'),
        ),
        migrations.AddField(
            model_name='csv',
            name='space',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='csv_import', to='multiplicity.ReferenceSpace'),
        ),
        migrations.AddField(
            model_name='csv',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
