<reponame>bpotvin-bccrc/colossus
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-07-12 18:40
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import simple_history.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AnalysisRun',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_updated', models.DateTimeField(default=django.utils.timezone.now, null=True, verbose_name='Analysis last updated date/time')),
                ('run_status', models.CharField(choices=[('idle', 'Idle'), ('error', 'Error'), ('running', 'Running'), ('archiving', 'Archiving'), ('complete', 'Complete'), ('align_complete', 'Align Complete'), ('hmmcopy_complete', 'Hmmcopy Complete')], default='idle', max_length=50, verbose_name='Run Status')),
                ('log_file', models.CharField(blank=True, default=None, max_length=1000, null=True, verbose_name='error_log')),
                ('sftp_path', models.CharField(blank=True, max_length=50, null=True, verbose_name='sftp path')),
                ('blob_path', models.CharField(blank=True, max_length=50, null=True, verbose_name='Blob path')),
            ],
        ),
        migrations.CreateModel(
            name='DlpAnalysisInformation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('analysis_jira_ticket', models.CharField(max_length=50, null=True, verbose_name='Analysis Jira ticket')),
                ('priority_level', models.CharField(choices=[('L', 'Low'), ('M', 'Medium'), ('H', 'High')], default='L', max_length=50, verbose_name='Priority Level')),
                ('aligner', models.CharField(choices=[('A', 'bwa-aln'), ('M', 'bwa-mem')], default='A', max_length=50, verbose_name='Aligner')),
                ('smoothing', models.CharField(choices=[('M', 'modal'), ('L', 'loess')], default='M', max_length=50, verbose_name='Smoothing')),
                ('analysis_submission_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Analysis submission date')),
                ('verified', models.CharField(blank=True, choices=[('T', 'True'), ('F', 'False')], default='F', max_length=50, null=True, verbose_name='Verified')),
                ('analysis_run', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sisyphus.AnalysisRun')),
                ('lanes', models.ManyToManyField(blank=True, to='dlp.DlpLane')),
                ('library', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dlp.DlpLibrary', verbose_name='Library')),
            ],
            options={
                'ordering': ['pk'],
            },
        ),
        migrations.CreateModel(
            name='DlpAnalysisVersion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('version', models.CharField(max_length=50, verbose_name='DlpAnalysis Version')),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalAnalysisRun',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('last_updated', models.DateTimeField(default=django.utils.timezone.now, null=True, verbose_name='Analysis last updated date/time')),
                ('run_status', models.CharField(choices=[('idle', 'Idle'), ('error', 'Error'), ('running', 'Running'), ('archiving', 'Archiving'), ('complete', 'Complete'), ('align_complete', 'Align Complete'), ('hmmcopy_complete', 'Hmmcopy Complete')], default='idle', max_length=50, verbose_name='Run Status')),
                ('log_file', models.CharField(blank=True, default=None, max_length=1000, null=True, verbose_name='error_log')),
                ('sftp_path', models.CharField(blank=True, max_length=50, null=True, verbose_name='sftp path')),
                ('blob_path', models.CharField(blank=True, max_length=50, null=True, verbose_name='Blob path')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical analysis run',
                'db_table': 'analysis_run_history',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalDlpAnalysisInformation',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('analysis_jira_ticket', models.CharField(max_length=50, null=True, verbose_name='Analysis Jira ticket')),
                ('priority_level', models.CharField(choices=[('L', 'Low'), ('M', 'Medium'), ('H', 'High')], default='L', max_length=50, verbose_name='Priority Level')),
                ('aligner', models.CharField(choices=[('A', 'bwa-aln'), ('M', 'bwa-mem')], default='A', max_length=50, verbose_name='Aligner')),
                ('smoothing', models.CharField(choices=[('M', 'modal'), ('L', 'loess')], default='M', max_length=50, verbose_name='Smoothing')),
                ('analysis_submission_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Analysis submission date')),
                ('verified', models.CharField(blank=True, choices=[('T', 'True'), ('F', 'False')], default='F', max_length=50, null=True, verbose_name='Verified')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('analysis_run', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='sisyphus.AnalysisRun')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('library', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dlp.DlpLibrary', verbose_name='Library')),
            ],
            options={
                'verbose_name': 'historical dlp analysis information',
                'db_table': 'dlp_analysis_info_history',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalDlpAnalysisVersion',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('version', models.CharField(max_length=50, verbose_name='DlpAnalysis Version')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical dlp analysis version',
                'db_table': 'dlp_history_analysis_version',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalReferenceGenome',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('reference_genome', models.CharField(max_length=50, verbose_name='reference_genome')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical reference genome',
                'db_table': 'ref_genome_history',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='ReferenceGenome',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference_genome', models.CharField(max_length=50, verbose_name='reference_genome')),
            ],
        ),
        migrations.AddField(
            model_name='historicaldlpanalysisinformation',
            name='reference_genome',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='sisyphus.ReferenceGenome', verbose_name='ReferenceGenome'),
        ),
        migrations.AddField(
            model_name='historicaldlpanalysisinformation',
            name='version',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='sisyphus.DlpAnalysisVersion', verbose_name='Analysis Version'),
        ),
        migrations.AddField(
            model_name='dlpanalysisinformation',
            name='reference_genome',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='sisyphus.ReferenceGenome', verbose_name='ReferenceGenome'),
        ),
        migrations.AddField(
            model_name='dlpanalysisinformation',
            name='sequencings',
            field=models.ManyToManyField(to='dlp.DlpSequencing'),
        ),
        migrations.AddField(
            model_name='dlpanalysisinformation',
            name='version',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sisyphus.DlpAnalysisVersion', verbose_name='Analysis Version'),
        ),
    ]
