# Generated by Django 2.1.2 on 2019-09-25 22:56

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import storages.backends.s3boto3
import utils.data
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Competition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('title', models.CharField(max_length=256)),
                ('logo', models.ImageField(blank=True, null=True, upload_to=utils.data.PathWrapper('logos'))),
                ('created_when', models.DateTimeField(default=django.utils.timezone.now)),
                ('published', models.BooleanField(default=False)),
                ('secret_key', models.UUIDField(blank=True, default=uuid.uuid4, null=True, unique=True)),
                ('registration_auto_approve', models.BooleanField(default=False)),
                ('terms', models.TextField(blank=True, null=True)),
                ('is_migrating', models.BooleanField(default=False)),
                ('description', models.TextField(blank=True, null=True)),
                ('docker_image', models.CharField(default='codalab/codalab-legacy:py3', max_length=128)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CompetitionCreationTaskStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Starting', 'None'), ('Finished', 'Finished'), ('Failed', 'Failed')], null=True)),
                ('details', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompetitionDump',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Starting', 'None'), ('Finished', 'Finished'), ('Failed', 'Failed')], null=True)),
                ('details', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompetitionParticipant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('status', models.CharField(choices=[('unknown', 'unknown'), ('denied', 'denied'), ('approved', 'approved'), ('pending', 'pending')], default='unknown', max_length=128)),
                ('reason', models.CharField(blank=True, max_length=100, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField(max_length=255)),
                ('content', models.TextField()),
                ('index', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Phase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Previous', 'Previous'), ('Current', 'Current'), ('Next', 'Next'), ('Final', 'Final')], null=True)),
                ('index', models.PositiveIntegerField()),
                ('start', models.DateTimeField()),
                ('end', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=256)),
                ('description', models.TextField(blank=True, null=True)),
                ('execution_time_limit', models.PositiveIntegerField(default=600)),
                ('auto_migrate_to_this_phase', models.BooleanField(default=False)),
                ('has_been_migrated', models.BooleanField(default=False)),
                ('has_max_submissions', models.BooleanField(default=False)),
                ('max_submissions_per_day', models.PositiveIntegerField(blank=True, null=True)),
                ('max_submissions_per_person', models.PositiveIntegerField(blank=True, null=True)),
            ],
            options={
                'ordering': ('index',),
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('description', models.CharField(blank=True, default='', max_length=240, null=True)),
                ('status', models.CharField(choices=[('None', 'None'), ('Submitting', 'Submitting'), ('Submitted', 'Submitted'), ('Preparing', 'Preparing'), ('Running', 'Running'), ('Scoring', 'Scoring'), ('Cancelled', 'Cancelled'), ('Finished', 'Finished'), ('Failed', 'Failed')], default='Submitting', max_length=128)),
                ('status_details', models.TextField(blank=True, null=True)),
                ('appear_on_leaderboards', models.BooleanField(default=False)),
                ('prediction_result', models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('prediction_result'))),
                ('scoring_result', models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('scoring_result'))),
                ('secret', models.UUIDField(default=uuid.uuid4)),
                ('task_id', models.UUIDField(blank=True, null=True)),
                ('name', models.CharField(blank=True, default='', max_length=120, null=True)),
                ('score', models.DecimalField(blank=True, decimal_places=10, default=None, max_digits=20, null=True)),
                ('created_when', models.DateTimeField(default=django.utils.timezone.now)),
                ('is_public', models.BooleanField(default=False)),
                ('is_migrated', models.BooleanField(default=False)),
                ('has_children', models.BooleanField(default=False)),
                ('created_by_migration', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='migrated_submissions', to='competitions.Phase')),
            ],
        ),
        migrations.CreateModel(
            name='SubmissionDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('data_file', models.FileField(storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('submission_details'))),
                ('is_scoring', models.BooleanField(default=False)),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='details', to='competitions.Submission')),
            ],
        ),
    ]

# Generated by Django 2.1.2 on 2019-09-25 22:56

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import storages.backends.s3boto3
import utils.data
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Competition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('title', models.CharField(max_length=256)),
                ('logo', models.ImageField(blank=True, null=True, upload_to=utils.data.PathWrapper('logos'))),
                ('created_when', models.DateTimeField(default=django.utils.timezone.now)),
                ('published', models.BooleanField(default=False)),
                ('secret_key', models.UUIDField(blank=True, default=uuid.uuid4, null=True, unique=True)),
                ('registration_auto_approve', models.BooleanField(default=False)),
                ('terms', models.TextField(blank=True, null=True)),
                ('is_migrating', models.BooleanField(default=False)),
                ('description', models.TextField(blank=True, null=True)),
                ('docker_image', models.CharField(default='codalab/codalab-legacy:py3', max_length=128)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CompetitionCreationTaskStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Starting', 'None'), ('Finished', 'Finished'), ('Failed', 'Failed')], null=True)),
                ('details', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompetitionDump',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Starting', 'None'), ('Finished', 'Finished'), ('Failed', 'Failed')], null=True)),
                ('details', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompetitionParticipant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('status', models.CharField(choices=[('unknown', 'unknown'), ('denied', 'denied'), ('approved', 'approved'), ('pending', 'pending')], default='unknown', max_length=128)),
                ('reason', models.CharField(blank=True, max_length=100, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField(max_length=255)),
                ('content', models.TextField()),
                ('index', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Phase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(blank=True, choices=[('Previous', 'Previous'), ('Current', 'Current'), ('Next', 'Next'), ('Final', 'Final')], null=True)),
                ('index', models.PositiveIntegerField()),
                ('start', models.DateTimeField()),
                ('end', models.DateTimeField(blank=True, null=True)),
                ('name', models.CharField(max_length=256)),
                ('description', models.TextField(blank=True, null=True)),
                ('execution_time_limit', models.PositiveIntegerField(default=600)),
                ('auto_migrate_to_this_phase', models.BooleanField(default=False)),
                ('has_been_migrated', models.BooleanField(default=False)),
                ('has_max_submissions', models.BooleanField(default=False)),
                ('max_submissions_per_day', models.PositiveIntegerField(blank=True, null=True)),
                ('max_submissions_per_person', models.PositiveIntegerField(blank=True, null=True)),
            ],
            options={
                'ordering': ('index',),
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chahub_timestamp', models.DateTimeField(blank=True, null=True)),
                ('chahub_data_hash', models.TextField(blank=True, null=True)),
                ('chahub_needs_retry', models.BooleanField(default=False)),
                ('description', models.CharField(blank=True, default='', max_length=240, null=True)),
                ('status', models.CharField(choices=[('None', 'None'), ('Submitting', 'Submitting'), ('Submitted', 'Submitted'), ('Preparing', 'Preparing'), ('Running', 'Running'), ('Scoring', 'Scoring'), ('Cancelled', 'Cancelled'), ('Finished', 'Finished'), ('Failed', 'Failed')], default='Submitting', max_length=128)),
                ('status_details', models.TextField(blank=True, null=True)),
                ('appear_on_leaderboards', models.BooleanField(default=False)),
                ('prediction_result', models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('prediction_result'))),
                ('scoring_result', models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('scoring_result'))),
                ('secret', models.UUIDField(default=uuid.uuid4)),
                ('task_id', models.UUIDField(blank=True, null=True)),
                ('name', models.CharField(blank=True, default='', max_length=120, null=True)),
                ('score', models.DecimalField(blank=True, decimal_places=10, default=None, max_digits=20, null=True)),
                ('created_when', models.DateTimeField(default=django.utils.timezone.now)),
                ('is_public', models.BooleanField(default=False)),
                ('is_migrated', models.BooleanField(default=False)),
                ('has_children', models.BooleanField(default=False)),
                ('created_by_migration', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='migrated_submissions', to='competitions.Phase')),
            ],
        ),
        migrations.CreateModel(
            name='SubmissionDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('data_file', models.FileField(storage=storages.backends.s3boto3.S3Boto3Storage(bucket='private'), upload_to=utils.data.PathWrapper('submission_details'))),
                ('is_scoring', models.BooleanField(default=False)),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='details', to='competitions.Submission')),
            ],
        ),
    ]

# Generated by Django 2.1.2 on 2019-09-25 22:56