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

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


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('events', '0005_auto_20150907_2021'),
    ]

    operations = [
        migrations.CreateModel(
            name='EventRanking',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True,
                                        primary_key=True)),
                ('placement',
                 models.PositiveIntegerField(null=True, blank=True)),
                ('avg_placement', models.FloatField(default=4)),
                ('avg_score', models.FloatField(default=0)),
                ('hanchan_count', models.PositiveIntegerField(default=0)),
                ('good_hanchans', models.PositiveIntegerField(default=0)),
                ('won_hanchans', models.PositiveIntegerField(default=0)),
                ('event', models.ForeignKey(to='events.Event',
                                            on_delete=models.CASCADE)),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL,
                                           on_delete=models.CASCADE)),
            ],
            options={
                'ordering': ('placement', 'avg_placement', '-avg_score'),
            },
        ),
        migrations.CreateModel(
            name='Hanchan',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True,
                                        primary_key=True)),
                ('start', models.DateTimeField(
                    help_text='Wichtig damit die richtigen Hanchans in die Wertung kommen.',
                    verbose_name='Beginn')),
                ('player1_input_score',
                 models.IntegerField(verbose_name='Punkte')),
                ('player1_game_score', models.PositiveIntegerField(
                    default=0, verbose_name='Punkte', editable=False)),
                ('player1_placement', models.PositiveSmallIntegerField(
                    default=0, editable=False)),
                ('player1_kyu_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player1_dan_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player1_bonus_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player1_comment', models.CharField(verbose_name='Anmerkung',
                                                     max_length=255,
                                                     editable=False,
                                                     blank=True)),
                ('player2_input_score',
                 models.IntegerField(verbose_name='Punkte')),
                ('player2_game_score', models.PositiveIntegerField(
                    default=0, verbose_name='Punkte', editable=False)),
                ('player2_placement', models.PositiveSmallIntegerField(
                    default=0, editable=False)),
                ('player2_kyu_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player2_dan_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player2_bonus_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player2_comment', models.CharField(verbose_name='Anmerkung',
                                                     max_length=255,
                                                     editable=False,
                                                     blank=True)),
                ('player3_input_score',
                 models.IntegerField(verbose_name='Punkte')),
                ('player3_game_score', models.PositiveIntegerField(
                    default=0, verbose_name='Punkte', editable=False)),
                ('player3_placement', models.PositiveSmallIntegerField(
                    default=0, editable=False)),
                ('player3_kyu_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player3_dan_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player3_bonus_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player3_comment', models.CharField(verbose_name='Anmerkung',
                                                     max_length=255,
                                                     editable=False,
                                                     blank=True)),
                ('player4_input_score',
                 models.IntegerField(verbose_name='Punkte')),
                ('player4_game_score', models.PositiveIntegerField(
                    default=0, verbose_name='Punkte', editable=False)),
                ('player4_placement', models.PositiveSmallIntegerField(
                    default=0, editable=False)),
                ('player4_kyu_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player4_dan_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player4_bonus_points', models.SmallIntegerField(
                    null=True, editable=False, blank=True)),
                ('player4_comment', models.CharField(verbose_name='Anmerkung',
                                                     max_length=255,
                                                     editable=False,
                                                     blank=True)),
                ('comment',
                 models.TextField(verbose_name='Anmerkung', blank=True)),
                ('confirmed', models.BooleanField(
                    default=True,
                    help_text='Nur g\xfcltige und best\xe4tigte Hanchans kommen in die Wertung.',
                    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(to='events.Event',
                                            on_delete=models.CASCADE)),
                ('player1', models.ForeignKey(related_name='user_hanchan+',
                                              verbose_name='Spieler 1',
                                              to=settings.AUTH_USER_MODEL,
                                              on_delete=models.CASCADE)),
                ('player2', models.ForeignKey(related_name='user_hanchan+',
                                              verbose_name='Spieler 2',
                                              to=settings.AUTH_USER_MODEL,
                                              on_delete=models.CASCADE)),
                ('player3', models.ForeignKey(related_name='user_hanchan+',
                                              verbose_name='Spieler 3',
                                              to=settings.AUTH_USER_MODEL,
                                              on_delete=models.CASCADE)),
                ('player4', models.ForeignKey(related_name='user_hanchan+',
                                              verbose_name='Spieler 4',
                                              to=settings.AUTH_USER_MODEL,
                                              on_delete=models.CASCADE)),
            ],
            options={
                'ordering': ('-start',),
                'verbose_name': 'Hanchan',
                'verbose_name_plural': 'Hanchans',
            },
        ),
        migrations.CreateModel(
            name='KyuDanRanking',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True,
                                        primary_key=True)),
                (
                    'dan',
                    models.PositiveSmallIntegerField(null=True, blank=True)),
                ('dan_points', models.PositiveIntegerField(default=0)),
                ('kyu', models.PositiveSmallIntegerField(
                    default=10, null=True, blank=True)),
                ('kyu_points', models.PositiveIntegerField(default=0)),
                ('won_hanchans', models.PositiveIntegerField(default=0)),
                ('good_hanchans', models.PositiveIntegerField(default=0)),
                ('hanchan_count', models.PositiveIntegerField(default=0)),
                ('legacy_date', models.DateField(null=True, blank=True)),
                ('legacy_dan_points', models.PositiveIntegerField(default=0)),
                ('legacy_kyu_points', models.PositiveIntegerField(default=0)),
                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL,
                                              on_delete=models.CASCADE)),
            ],
            options={
                'ordering': ('-dan', '-dan_points', '-kyu_points'),
                'verbose_name': 'Ky\u016b/Dan Wertung',
                'verbose_name_plural': 'Ky\u016b/Dan Wertungen',
            },
        ),
        migrations.CreateModel(
            name='SeasonRanking',
            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.FloatField(null=True, blank=True)),
                ('avg_score', models.FloatField(null=True, blank=True)),
                ('hanchan_count', models.PositiveIntegerField(default=0)),
                ('good_hanchans', models.PositiveIntegerField(default=0)),
                ('won_hanchans', models.PositiveIntegerField(default=0)),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL,
                                           on_delete=models.CASCADE)),
            ],
            options={
                'ordering': ('placement', 'avg_placement', '-avg_score'),
            },
        ),
    ]
