# Generated by Django 2.1.4 on 2018-12-05 14:30

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(auto_now_add=True, verbose_name='Data meczu')),
            ],
            options={
                'verbose_name': 'Mecz',
                'verbose_name_plural': 'Mecze',
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=64, verbose_name='Imię')),
                ('last_name', models.CharField(max_length=64, verbose_name='Nazwisko')),
                ('rating', models.IntegerField(default=1000, verbose_name='Ranking')),
            ],
            options={
                'verbose_name': 'Zawodnik',
                'verbose_name_plural': 'Zawodnicy',
            },
        ),
        migrations.CreateModel(
            name='PlayerHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.IntegerField(verbose_name='Ranking')),
                ('match', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='klask.Match', verbose_name='Mecz')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='klask.Player', verbose_name='Zawodnik')),
            ],
            options={
                'verbose_name': 'Historia zawodnika',
                'verbose_name_plural': 'Historie zawodnika',
            },
        ),
        migrations.AddField(
            model_name='match',
            name='looser',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='player_looser', to='klask.Player', verbose_name='Przegrany'),
        ),
        migrations.AddField(
            model_name='match',
            name='winner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='player_winner', to='klask.Player', verbose_name='Zwycięzca'),
        ),
    ]
