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

from django.db import models, migrations
from django.conf import settings


class Migration(migrations.Migration):

    dependencies = [
        ('events', '__first__'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True, primary_key=True)),
                ('comment', models.TextField(verbose_name='Anmerkung', blank=True)),
                ('player1_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player1_placement', models.PositiveSmallIntegerField(editable=False)),
                ('player2_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player2_placement', models.PositiveSmallIntegerField(editable=False)),
                ('player3_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player3_placement', models.PositiveSmallIntegerField(editable=False)),
                ('player4_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player4_placement', models.PositiveSmallIntegerField(editable=False)),
                ('player5_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player5_placement', models.PositiveSmallIntegerField(editable=False)),
                ('player6_score', models.SmallIntegerField(verbose_name='Punkte')),
                ('player6_placement', models.PositiveSmallIntegerField(editable=False)),
                ('confirmed', models.BooleanField(
                    default=True, help_text='das Spiel z\xe4hlt nur wenn es best\xe4tigt wurde', verbose_name='Wurde best\xe4tigt')),
                ('player_names', models.CharField(max_length=255, editable=False)),
                ('season', models.PositiveSmallIntegerField(
                    verbose_name='Saison', editable=False, db_index=True)),
                ('event', models.ForeignKey(
                    related_name='maistargame_set', to='events.Event', on_delete=models.CASCADE)),
                ('player1', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 1', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
                ('player2', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 2', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
                ('player3', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 3', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
                ('player4', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 4', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
                ('player5', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 5', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
                ('player6', models.ForeignKey(related_name='+',
                                              verbose_name='Spieler 6', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
            ],
        ),
        migrations.CreateModel(
            name='Ranking',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True, primary_key=True)),
                ('season', models.PositiveSmallIntegerField(verbose_name='Saison')),
                ('placement', models.PositiveIntegerField(null=True, blank=True)),
                ('avg_placement', models.PositiveSmallIntegerField(
                    null=True, blank=True)),
                ('avg_score', models.SmallIntegerField(null=True, blank=True)),
                ('games_count', models.PositiveSmallIntegerField(default=0)),
                ('games_good', models.PositiveSmallIntegerField(default=0)),
                ('games_won', models.PositiveSmallIntegerField(default=0)),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
            ],
            options={
                'ordering': ('-season', 'placement', 'avg_placement', '-avg_score'),
            },
        ),
    ]
