# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-12 13:03
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('player', '0001_initial'),
        ('club', '0001_initial'),
        ('settings', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tournament',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255)),
                ('name_en', models.CharField(max_length=255, null=True)),
                ('name_ru', models.CharField(max_length=255, null=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField()),
                ('number_of_sessions', models.PositiveSmallIntegerField(blank=True, default=0)),
                ('number_of_players', models.PositiveSmallIntegerField(blank=True, default=0)),
                ('game_type', models.PositiveSmallIntegerField(choices=[[0, 'Riichi'], [1, 'MCR']], default=0)),
                ('registration_description', models.TextField(blank=True, default='', null=True)),
                ('registration_description_en', models.TextField(blank=True, default='', null=True)),
                ('registration_description_ru', models.TextField(blank=True, default='', null=True)),
                ('registration_link', models.URLField(blank=True, default='', null=True)),
                ('is_upcoming', models.BooleanField(default=False)),
                ('need_qualification', models.BooleanField(default=False)),
                ('has_accreditation', models.BooleanField(default=True)),
                ('opened_registration', models.BooleanField(default=False)),
                ('pantheon_id', models.CharField(blank=True, max_length=20, null=True)),
                ('ema_id', models.CharField(blank=True, max_length=20, null=True)),
                ('city', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='settings.City')),
                ('clubs', models.ManyToManyField(blank=True, to='club.Club')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='settings.Country')),
                ('tournament_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='settings.TournamentType')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TournamentRegistration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('first_name', models.CharField(max_length=255, verbose_name='First name')),
                ('last_name', models.CharField(max_length=255, verbose_name='Last name')),
                ('city', models.CharField(max_length=255, verbose_name='City')),
                ('phone', models.CharField(help_text='It will be visible only to the administrator', max_length=255, verbose_name='Phone')),
                ('city_object', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='settings.City')),
                ('player', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tournament_registrations', to='player.Player')),
                ('tournament', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tournament_registrations', to='tournament.Tournament')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TournamentResult',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('place', models.PositiveSmallIntegerField()),
                ('scores', models.DecimalField(blank=True, decimal_places=2, default=None, max_digits=10, null=True)),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tournament_results', to='player.Player')),
                ('tournament', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='results', to='tournament.Tournament')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
