# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-09 11:44
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BaseDataEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BaseMLMetrics',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DataframeColumn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('name', models.TextField()),
                ('index', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='DataframeModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('name', models.TextField(unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrecisionRecallCurvePoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('threshold', models.DecimalField(decimal_places=1, max_digits=8)),
                ('precision', models.DecimalField(decimal_places=1, max_digits=8)),
                ('recall', models.DecimalField(decimal_places=1, max_digits=8)),
                ('metrics', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.BaseMLMetrics')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Prediction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('data', models.TextField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PredictionPipeline',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('name', models.TextField(unique=True)),
                ('dataframe', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='prediction_playground.DataframeModel')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PredictionSubject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='ROCCurvePoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('threshold', models.DecimalField(decimal_places=1, max_digits=8)),
                ('fpr', models.DecimalField(decimal_places=1, max_digits=8)),
                ('tpr', models.DecimalField(decimal_places=1, max_digits=8)),
                ('metrics', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.BaseMLMetrics')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SKPipeline',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('file', models.FileField(upload_to='saved_data\\')),
                ('sklearn_version', models.TextField(default=b'0.19.1', editable=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FirebaseUser',
            fields=[
                ('predictionsubject_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='prediction_playground.PredictionSubject')),
                ('firebase_token', models.TextField()),
            ],
            bases=('prediction_playground.predictionsubject',),
        ),
        migrations.CreateModel(
            name='JSONDataEntry',
            fields=[
                ('basedataentry_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='prediction_playground.BaseDataEntry')),
                ('data', models.TextField()),
            ],
            options={
                'abstract': False,
            },
            bases=('prediction_playground.basedataentry',),
        ),
        migrations.AddField(
            model_name='skpipeline',
            name='entries',
            field=models.ManyToManyField(blank=True, to='prediction_playground.BaseDataEntry'),
        ),
        migrations.AddField(
            model_name='skpipeline',
            name='previous_version',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='prediction_playground.SKPipeline'),
        ),
        migrations.AddField(
            model_name='predictionpipeline',
            name='sk_pipeline',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='prediction_playground.SKPipeline'),
        ),
        migrations.AddField(
            model_name='predictionpipeline',
            name='target_columns',
            field=models.ManyToManyField(to='prediction_playground.DataframeColumn'),
        ),
        migrations.AddField(
            model_name='prediction',
            name='entry',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.BaseDataEntry'),
        ),
        migrations.AddField(
            model_name='prediction',
            name='sk_pipeline',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.SKPipeline'),
        ),
        migrations.AddField(
            model_name='dataframecolumn',
            name='dataframe',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.DataframeModel'),
        ),
        migrations.AddField(
            model_name='basemlmetrics',
            name='sk_pipeline',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.SKPipeline'),
        ),
        migrations.AddField(
            model_name='basedataentry',
            name='dataframe',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.DataframeModel'),
        ),
        migrations.AddField(
            model_name='basedataentry',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='prediction_playground.PredictionSubject'),
        ),
        migrations.AlterUniqueTogether(
            name='dataframecolumn',
            unique_together=set([('dataframe', 'name')]),
        ),
    ]
