# Generated by Django 2.1.3 on 2018-11-17 04:51

import datachimp.utils.generate_uid
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=254, null=True, unique=True)),
                ('username', models.CharField(max_length=100, null=True, unique=True)),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.TextField(blank=True, null=True)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='ExperimentCustomObject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('filesize', models.BigIntegerField(default=None, null=True)),
                ('custom_object_file', models.FileField(null=True, upload_to='custom_object/')),
                ('custom_object_id', models.CharField(default=None, max_length=50)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='ExperimentImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('metric_dict', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('epoch', models.IntegerField(default=None, null=True)),
                ('experiment_image', models.FileField(null=True, upload_to='experiment_image/')),
                ('custom_file_name', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='ExperimentMatPlot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('filesize', models.BigIntegerField(default=None, null=True)),
                ('mat_plot_file', models.FileField(null=True, upload_to='mat_plot/')),
                ('mat_plot_id', models.CharField(default=None, max_length=50)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Invitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('to_email', models.EmailField(max_length=254)),
                ('invite_clicked', models.BooleanField(default=False)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
                ('from_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='MachineLearningModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('algorithm', models.CharField(blank=True, default='', max_length=200, null=True)),
                ('platform', models.CharField(blank=True, choices=[('PYTHON', 'Python'), ('R', 'R'), ('JULIA', 'Julia'), ('EXCEL', 'Excel')], default='', max_length=200, null=True)),
                ('platform_library', models.CharField(blank=True, choices=[('1', 'Sklearn'), ('2', 'Keras')], default='', max_length=5, null=True)),
                ('experiment_id', models.CharField(default=datachimp.utils.generate_uid.generate_uid, max_length=70, unique=True)),
                ('dataset_id', models.CharField(default='', max_length=100, null=True)),
                ('status', models.CharField(blank=True, choices=[(1, 'In Process'), (2, 'Completed')], default=2, max_length=5, null=True)),
                ('comment_count', models.IntegerField(default=0)),
                ('labels', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('features', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('model_parameters', django.contrib.postgres.fields.jsonb.JSONField(default=dict, null=True)),
                ('evaluation_parameters', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('deep_learning_parameters', django.contrib.postgres.fields.jsonb.JSONField(default=list, null=True)),
                ('epoch_durations', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('ml_model_file', models.FileField(null=True, upload_to='model/')),
                ('code_file', models.FileField(null=True, upload_to='code/')),
                ('experiment_start', models.DateTimeField(null=True)),
                ('experiment_end', models.DateTimeField(null=True)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
                ('last_heart_beat', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Membership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_owner', models.BooleanField(default=False)),
                ('key', models.CharField(default=None, max_length=50)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('avatar', models.ImageField(null=True, upload_to='profile/')),
                ('avatar_url', models.URLField(null=True)),
                ('first_name', models.CharField(blank=True, default='', max_length=200)),
                ('last_name', models.CharField(blank=True, default='', max_length=200)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=200)),
                ('description', models.TextField(blank=True, null=True)),
                ('slug', models.SlugField(default='')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_modified', models.DateTimeField(auto_now=True)),
                ('members', models.ManyToManyField(related_name='members', through='datachimp.Membership', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='membership',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='membership',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='machinelearningmodel',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ml_model_project', to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='machinelearningmodel',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='invitation',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='experimentmatplot',
            name='ml_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mat_plot_experiment', to='datachimp.MachineLearningModel'),
        ),
        migrations.AddField(
            model_name='experimentmatplot',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mat_plot_project', to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='experimentimage',
            name='ml_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image_experiment', to='datachimp.MachineLearningModel'),
        ),
        migrations.AddField(
            model_name='experimentimage',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image_project', to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='experimentcustomobject',
            name='ml_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_object_experiment', to='datachimp.MachineLearningModel'),
        ),
        migrations.AddField(
            model_name='experimentcustomobject',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_object_project', to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='comment',
            name='ml_model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment_ml_model', to='datachimp.MachineLearningModel'),
        ),
        migrations.AddField(
            model_name='comment',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datachimp.Project'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='membership',
            unique_together={('project', 'user')},
        ),
    ]
