# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-06-02 03:02
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='League',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('year', models.IntegerField()),
                ('parent', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('home_score', models.IntegerField()),
                ('away_score', models.IntegerField()),
                ('date', models.DateField(null=True)),
                ('round', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('parent', models.CharField(max_length=100)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='team',
            unique_together=set([('name', 'parent')]),
        ),
        migrations.AddField(
            model_name='match',
            name='away_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='away_team', to='soccer.Team'),
        ),
        migrations.AddField(
            model_name='match',
            name='home_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='home_team', to='soccer.Team'),
        ),
        migrations.AddField(
            model_name='match',
            name='league',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='soccer.League'),
        ),
        migrations.AlterUniqueTogether(
            name='league',
            unique_together=set([('name', 'year', 'parent')]),
        ),
        migrations.AlterUniqueTogether(
            name='match',
            unique_together=set([('league', 'home_team', 'away_team', 'round')]),
        ),
    ]
