# Generated by Django 2.0.10 on 2019-03-25 10:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('scores', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Lineup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_captain', models.BooleanField(default=True)),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Game')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Player')),
                ('position', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='scores.Position')),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Team')),
            ],
        ),
        migrations.CreateModel(
            name='Squad',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.PositiveSmallIntegerField(null=True)),
                ('competition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Competition')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Player')),
                ('position', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='scores.Position')),
                ('season', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Season')),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='scores.Team')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='squad',
            unique_together={('competition', 'season', 'team', 'player')},
        ),
        migrations.AddIndex(
            model_name='lineup',
            index=models.Index(fields=['player', 'game', 'team'], name='scores_line_player__7dbf6d_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='lineup',
            unique_together={('player', 'game')},
        ),
    ]
