# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-28 13:25
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Participation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('victories', models.PositiveSmallIntegerField()),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='funrun_history.Match')),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.PositiveSmallIntegerField()),
                ('participation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='funrun_history.Participation', unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=254, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='RaisingRates',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.PositiveSmallIntegerField()),
                ('participation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='funrun_history.Participation', unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sheet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.ImageField(blank=True, null=True, upload_to='history/facts/')),
                ('rows', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('columns', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('matches', models.ManyToManyField(to='funrun_history.Match')),
            ],
        ),
        migrations.AddField(
            model_name='participation',
            name='player',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='funrun_history.Player'),
        ),
        migrations.AlterUniqueTogether(
            name='participation',
            unique_together=set([('match', 'player')]),
        ),
    ]
