# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Certificate',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Exercise',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('original_version', models.ForeignKey(to='duplicable_testapp.Exercise', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.Exercise', null=True, related_name='direct_duplicates')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Hint',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('exercise', models.ForeignKey(to='duplicable_testapp.Exercise')),
                ('original_version', models.ForeignKey(to='duplicable_testapp.Hint', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.Hint', null=True, related_name='direct_duplicates')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ParticipatedTraining',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('date', models.DateField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('favorite_exercises', models.ManyToManyField(to='duplicable_testapp.Exercise')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PlannedExercise',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('order', models.PositiveIntegerField()),
                ('exercise', models.ForeignKey(to='duplicable_testapp.Exercise')),
                ('original_version', models.ForeignKey(to='duplicable_testapp.PlannedExercise', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.PlannedExercise', null=True, related_name='direct_duplicates')),
                ('plan', models.ForeignKey(to='duplicable_testapp.Plan')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Reward',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Solution',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('exercise', models.OneToOneField(to='duplicable_testapp.Exercise')),
                ('original_version', models.ForeignKey(to='duplicable_testapp.Solution', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.Solution', null=True, related_name='direct_duplicates')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Survey',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('original_version', models.ForeignKey(to='duplicable_testapp.Survey', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.Survey', null=True, related_name='direct_duplicates')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Training',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
                ('name', models.CharField(max_length=100)),
                ('test_file', models.FileField(upload_to='')),
                ('author', models.ForeignKey(to='duplicable_testapp.Person')),
                ('original_version', models.ForeignKey(to='duplicable_testapp.Training', null=True, related_name='all_duplicates')),
                ('parent_version', models.ForeignKey(to='duplicable_testapp.Training', null=True, related_name='direct_duplicates')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='survey',
            name='training',
            field=models.ForeignKey(to='duplicable_testapp.Training'),
        ),
        migrations.AddField(
            model_name='plan',
            name='exercises',
            field=models.ManyToManyField(through='duplicable_testapp.PlannedExercise', to='duplicable_testapp.Exercise'),
        ),
        migrations.AddField(
            model_name='plan',
            name='original_version',
            field=models.ForeignKey(to='duplicable_testapp.Plan', null=True, related_name='all_duplicates'),
        ),
        migrations.AddField(
            model_name='plan',
            name='parent_version',
            field=models.ForeignKey(to='duplicable_testapp.Plan', null=True, related_name='direct_duplicates'),
        ),
        migrations.AddField(
            model_name='plan',
            name='training',
            field=models.ForeignKey(to='duplicable_testapp.Training'),
        ),
        migrations.AddField(
            model_name='person',
            name='participated_trainings',
            field=models.ManyToManyField(through='duplicable_testapp.ParticipatedTraining', to='duplicable_testapp.Training'),
        ),
        migrations.AddField(
            model_name='participatedtraining',
            name='attendee',
            field=models.ForeignKey(to='duplicable_testapp.Person'),
        ),
        migrations.AddField(
            model_name='participatedtraining',
            name='plan',
            field=models.ForeignKey(to='duplicable_testapp.Plan'),
        ),
        migrations.AddField(
            model_name='participatedtraining',
            name='training',
            field=models.ForeignKey(to='duplicable_testapp.Training'),
        ),
        migrations.AddField(
            model_name='exercise',
            name='rewards',
            field=models.ManyToManyField(to='duplicable_testapp.Reward'),
        ),
        migrations.AddField(
            model_name='exercise',
            name='training',
            field=models.ForeignKey(to='duplicable_testapp.Training'),
        ),
        migrations.AddField(
            model_name='certificate',
            name='plan',
            field=models.OneToOneField(to='duplicable_testapp.Plan'),
        ),
    ]
