# Generated by Django 3.0.1 on 2020-02-15 19:43

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import schedules.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='RequestData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('coursebin', django.contrib.postgres.fields.jsonb.JSONField(validators=[schedules.validators.coursebin_validator])),
                ('preference', django.contrib.postgres.fields.jsonb.JSONField(validators=[schedules.validators.preference_validator])),
            ],
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('early_score', models.FloatField()),
                ('late_score', models.FloatField()),
                ('break_score', models.FloatField()),
                ('reserved_score', models.FloatField()),
                ('total_score', models.FloatField()),
                ('public', models.BooleanField(default=False)),
                ('name', models.CharField(blank=True, default='', max_length=100)),
                ('saved', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-task__created', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(choices=[('PD', 'Pending'), ('PS', 'Processing'), ('DN', 'Done'), ('WN', 'Waring'), ('ER', 'Error'), ('EX', 'Uncaught Exception')], max_length=2)),
                ('name', models.CharField(default=None, max_length=100, null=True)),
                ('message', models.CharField(default=None, max_length=200, null=True)),
                ('count', models.PositiveIntegerField(default=0)),
                ('request_data', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='task', to='schedules.RequestData')),
            ],
            options={
                'ordering': ['-created'],
            },
        ),
    ]
