# Generated by Django 2.0.6 on 2018-08-19 10:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('name', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('deadline', models.DateField()),
            ],
            options={
                'db_table': 'assignment',
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('name', models.CharField(max_length=200)),
                ('status', models.CharField(choices=[('active', 'active'), ('inactive', 'inactive')], max_length=200)),
                ('code', models.CharField(max_length=200, unique=200)),
                ('department', models.CharField(max_length=200)),
            ],
            options={
                'db_table': 'course',
            },
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'db_table': 'equipment',
            },
        ),
        migrations.CreateModel(
            name='Experiment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('description', models.TextField()),
                ('assignment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiments', to='university.Course')),
            ],
            options={
                'db_table': 'experiment',
            },
        ),
        migrations.CreateModel(
            name='ExperimentMetadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('input', models.BooleanField()),
                ('value', models.CharField(max_length=200)),
                ('experiment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiment_metadata', to='university.Experiment')),
            ],
            options={
                'db_table': 'experiment_metadata',
            },
        ),
        migrations.CreateModel(
            name='Metadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'db_table': 'metadata',
            },
        ),
        migrations.CreateModel(
            name='MetadataType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('name', models.CharField(max_length=200)),
                ('type', models.CharField(max_length=200)),
                ('range_start', models.CharField(max_length=200)),
                ('range_end', models.CharField(max_length=200)),
            ],
            options={
                'db_table': 'metadata_type',
            },
        ),
        migrations.CreateModel(
            name='RawFile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('file', models.FileField(upload_to='documents/%Y/%m/%d')),
                ('is_deleted', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'raw_file',
            },
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('description', models.TextField()),
                ('experiment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='university.Experiment')),
            ],
            options={
                'db_table': 'result',
            },
        ),
        migrations.CreateModel(
            name='ResultMetadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('value', models.CharField(max_length=200)),
                ('input', models.BooleanField()),
                ('metadata', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='university.Metadata')),
                ('result', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='result_metadata', to='university.Result')),
            ],
            options={
                'db_table': 'result_metadata',
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('modified_at', models.DateTimeField(auto_now=True, verbose_name='Modified at')),
                ('submission_date', models.DateField(auto_now_add=True)),
                ('comment', models.TextField()),
                ('assignment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='university.Assignment')),
                ('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='university.Equipment')),
            ],
            options={
                'db_table': 'submission',
            },
        ),
        migrations.AddField(
            model_name='result',
            name='submission',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='university.Submission'),
        ),
        migrations.AddField(
            model_name='rawfile',
            name='result',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='files', to='university.Result'),
        ),
        migrations.AddField(
            model_name='metadata',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='metadatas', to='university.MetadataType'),
        ),
        migrations.AddField(
            model_name='experimentmetadata',
            name='metadata',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='university.Metadata'),
        ),
        migrations.AddField(
            model_name='assignment',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assignments', to='university.Course'),
        ),
    ]
