# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-28 05:37
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='FilesToGalaxyDataLibraryParam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('folder_name', models.CharField(blank=True, max_length=200, null=True)),
                ('link2files', models.BooleanField(default=False)),
                ('local_path', models.BooleanField(default=False)),
                ('ftp', models.BooleanField(default=True, help_text='Use FTP file transfer to copy the files over to theGalaxy instance')),
                ('remove', models.BooleanField(default=False, help_text='Remove any existing data for the selected ISA projects in the Galaxy data libraries')),
                ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GalaxyFileLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('galaxy_id', models.CharField(max_length=250)),
                ('galaxy_library', models.BooleanField(default=True)),
                ('removed', models.BooleanField(default=False, help_text='if the Galaxy file has either been purged or deleted. However the "deleted" options does not seem to be recorded correctly for ldda (library dasasets) by Galaxy so can be a bit  misleading. However if we can no longer access the  file in Bioblend then this should be set to True.')),
            ],
        ),
        migrations.CreateModel(
            name='GalaxyInstanceTracking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField()),
                ('name', models.CharField(max_length=200, unique=True)),
                ('ftp_host', models.CharField(blank=True, help_text='The ftp host and port are required if the file server and galaxy server cannot be connected either direcly or via symlink)', max_length=200, null=True)),
                ('ftp_port', models.IntegerField(blank=True, default=21, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='GalaxyUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(help_text='the email used for the Galaxy account', max_length=254)),
                ('api_key', models.CharField(max_length=200)),
                ('galaxyinstancetracking', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GenericFilesToGalaxyHistoryParam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('history_name', models.CharField(max_length=200)),
                ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('galaxyinstancetracking', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking')),
            ],
        ),
        migrations.CreateModel(
            name='History',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('update_time', models.CharField(max_length=200)),
                ('name', models.CharField(max_length=200)),
                ('empty', models.IntegerField()),
                ('error', models.IntegerField()),
                ('failed_metadata', models.IntegerField()),
                ('new', models.IntegerField()),
                ('ok', models.IntegerField()),
                ('paused', models.IntegerField()),
                ('running', models.IntegerField()),
                ('queued', models.IntegerField()),
                ('setting_metadata', models.IntegerField()),
                ('upload', models.IntegerField()),
                ('galaxy_id', models.CharField(max_length=200)),
                ('estimated_progress', models.FloatField()),
                ('galaxyinstancetracking', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking')),
            ],
        ),
        migrations.CreateModel(
            name='HistoryData',
            fields=[
                ('genericfile_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gfiles.GenericFile')),
                ('name', models.CharField(max_length=200)),
                ('history', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.History')),
            ],
            bases=('gfiles.genericfile',),
        ),
        migrations.CreateModel(
            name='Workflow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('workflowjson', models.TextField(max_length=5000)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(max_length=200)),
                ('galaxy_id', models.CharField(max_length=200)),
                ('latest_workflow_uuid', models.CharField(max_length=200)),
                ('accessible', models.BooleanField(default=True)),
                ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('galaxyinstancetracking', models.ForeignKey(help_text='The galaxy instance the Workflow should currently be performed on', null=True, on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking')),
            ],
        ),
        migrations.CreateModel(
            name='WorkflowInput',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, null=True)),
                ('step', models.CharField(max_length=200)),
                ('datatype', models.CharField(max_length=200)),
                ('workflow', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.Workflow')),
            ],
        ),
        migrations.CreateModel(
            name='WorkflowRun',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rundate', models.DateTimeField(auto_now_add=True)),
                ('library', models.BooleanField(help_text='Use files from data library')),
                ('history_name', models.CharField(max_length=200)),
                ('ran_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('workflow', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.Workflow')),
            ],
        ),
        migrations.AddField(
            model_name='galaxyfilelink',
            name='galaxyinstancetracking',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking'),
        ),
        migrations.AddField(
            model_name='galaxyfilelink',
            name='genericfile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gfiles.GenericFile'),
        ),
        migrations.AddField(
            model_name='filestogalaxydatalibraryparam',
            name='galaxyinstancetracking',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='galaxy.GalaxyInstanceTracking'),
        ),
        migrations.AlterUniqueTogether(
            name='history',
            unique_together=set([('galaxyinstancetracking', 'galaxy_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='galaxyuser',
            unique_together=set([('user', 'galaxyinstancetracking')]),
        ),
        migrations.AlterUniqueTogether(
            name='galaxyfilelink',
            unique_together=set([('galaxyinstancetracking', 'galaxy_id')]),
        ),
    ]
