# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-03 08:49
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contest', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contents', models.FileField(upload_to='')),
                ('comment', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='AttachmentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_company', models.BooleanField()),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('description', models.TextField(default='')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='p_author', to='task.Company')),
            ],
        ),
        migrations.CreateModel(
            name='ProblemModification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('prefix', models.CharField(blank=True, max_length=200)),
                ('comment', models.TextField()),
                ('archives', models.ManyToManyField(related_name='archive', to='contest.Archive')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pm_author', to='task.Company')),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='modification', to='task.Problem')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('coeff', models.FloatField(default=1.0)),
            ],
        ),
        migrations.CreateModel(
            name='TagProblem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('weight', models.IntegerField()),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='task.Problem')),
                ('problem_modification', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='task.ProblemModification')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='task.Tag')),
            ],
        ),
        migrations.AddField(
            model_name='tag',
            name='problem',
            field=models.ManyToManyField(blank=True, through='task.TagProblem', to='task.Problem'),
        ),
        migrations.AddField(
            model_name='tag',
            name='problem_modification',
            field=models.ManyToManyField(blank=True, through='task.TagProblem', to='task.ProblemModification'),
        ),
        migrations.AddField(
            model_name='attachment',
            name='problem',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='task.Problem'),
        ),
        migrations.AddField(
            model_name='attachment',
            name='problem_modification',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='task.ProblemModification'),
        ),
        migrations.AddField(
            model_name='attachment',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='task.AttachmentType'),
        ),
    ]
