# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-10 12:34
from __future__ import unicode_literals

import ckeditor.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import problemset.models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('problemset', '0003_testcase'),
    ]

    operations = [
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source_file', models.FileField(upload_to=problemset.models.source_directory_path)),
                ('status', models.IntegerField(choices=[(0, 'Pending'), (1, 'Success'), (2, 'Error')])),
                ('score', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='SubmissionError',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.IntegerField()),
            ],
        ),
        migrations.AlterField(
            model_name='problem',
            name='statement',
            field=ckeditor.fields.RichTextField(),
        ),
        migrations.AlterField(
            model_name='testcase',
            name='input_file',
            field=models.FileField(upload_to=problemset.models.testcase_directory_path),
        ),
        migrations.AlterField(
            model_name='testcase',
            name='output_file',
            field=models.FileField(upload_to=problemset.models.testcase_directory_path),
        ),
        migrations.AddField(
            model_name='submission',
            name='error',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='problemset.SubmissionError'),
        ),
        migrations.AddField(
            model_name='submission',
            name='problem',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problemset.Problem'),
        ),
        migrations.AddField(
            model_name='submission',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
