# Generated by Django 3.0.7 on 2020-10-12 15:51

import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import mainapp.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
                ('clean_name', models.CharField(max_length=30, unique=True)),
                ('short_name', models.CharField(max_length=5)),
                ('source_names', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='League',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('clean_name', models.CharField(max_length=30)),
                ('gender', models.IntegerField(choices=[(1, mainapp.models.GenderChoice['MALE']), (2, mainapp.models.GenderChoice['FEMALE'])], default=None, null=True)),
                ('degree', models.IntegerField(default=0)),
                ('schedule_url', models.CharField(default=None, max_length=200, null=True)),
                ('ranking_url', models.CharField(default=None, max_length=200, null=True)),
                ('channel_url', models.CharField(default=None, max_length=200, null=True)),
                ('mdays', models.IntegerField(default=None, null=True)),
                ('current_mday', models.IntegerField(default=None, null=True)),
                ('matches_by_mday', models.IntegerField(default=None, null=True)),
                ('team_count', models.IntegerField(default=0)),
                ('rounds', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), default=None, null=True, size=None)),
                ('groups', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), default=None, null=True, size=None)),
                ('points', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('promotions', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('images', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('schedule', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), default=None, null=True, size=None)),
                ('clean_tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=30), default=None, null=True, size=None)),
                ('news_count', models.IntegerField(default=0)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('country', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Country')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='Sport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True)),
                ('clean_name', models.CharField(max_length=20, unique=True)),
                ('display_sets', models.BooleanField(default=False)),
                ('points', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
                ('enabled', models.BooleanField(default=False)),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('clean_name', models.CharField(max_length=30)),
                ('short_name', models.CharField(default=None, max_length=30, null=True)),
                ('long_name', models.CharField(default=None, max_length=100, null=True)),
                ('gender', models.IntegerField(choices=[(1, mainapp.models.GenderChoice['MALE']), (2, mainapp.models.GenderChoice['FEMALE'])], default=None, null=True)),
                ('names', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('url', models.CharField(default=None, max_length=200, null=True)),
                ('images', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, null=True, size=None)),
                ('clean_tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, null=True, size=None)),
                ('news_count', models.IntegerField(default=0)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('country', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Country')),
                ('sport', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Sport')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('clean_name', models.CharField(max_length=30)),
                ('image_name', models.CharField(max_length=30)),
                ('big_image_name', models.CharField(max_length=30)),
                ('feed_url', models.CharField(max_length=200)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('sport', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Sport')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=100, unique=True)),
                ('clean_name', models.CharField(max_length=100, unique=True)),
                ('first_name', models.CharField(default=None, max_length=50, null=True)),
                ('last_name', models.CharField(default=None, max_length=50, null=True)),
                ('birth_date', models.DateField(default=None, null=True)),
                ('image', models.CharField(default=None, max_length=200, null=True)),
                ('number', models.IntegerField(default=None, null=True)),
                ('role', models.IntegerField(choices=[(1, mainapp.models.RoleChoice['GOALKEEPER']), (2, mainapp.models.RoleChoice['DEFENDER']), (3, mainapp.models.RoleChoice['MIDFIELDER']), (4, mainapp.models.RoleChoice['ATTACKER'])], default=None, null=True)),
                ('position', models.CharField(default=None, max_length=50, null=True)),
                ('age', models.IntegerField(default=None, null=True)),
                ('size', models.IntegerField(default=None, null=True)),
                ('foot', models.IntegerField(choices=[(1, mainapp.models.FootChoice['RIGHT']), (2, mainapp.models.FootChoice['LEFT']), (3, mainapp.models.FootChoice['BOTH'])], default=None, null=True)),
                ('contract_end', models.DateField(default=None, null=True)),
                ('price', models.IntegerField(default=None, null=True)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('country1', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='country1', to='mainapp.Country')),
                ('country2', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='country2', to='mainapp.Country')),
                ('sport', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Sport')),
                ('team', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='mainapp.Team')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=500, unique=True)),
                ('clean_title', models.CharField(max_length=500, unique=True)),
                ('link', models.CharField(max_length=500, unique=True)),
                ('pub_date', models.DateTimeField(default=None, null=True)),
                ('description', models.CharField(default=None, max_length=1000, null=True)),
                ('image', models.CharField(default=None, max_length=500, null=True)),
                ('teaser', models.CharField(default=None, max_length=2000, null=True)),
                ('author', models.CharField(default=None, max_length=100, null=True)),
                ('content', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=5000), default=None, null=True, size=None)),
                ('redirect', models.CharField(default=None, max_length=500, null=True)),
                ('haystack', models.CharField(default=None, max_length=2000, null=True)),
                ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, null=True, size=None)),
                ('clean_tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, null=True, size=None)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('league', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='mainapp.League')),
                ('source', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Source')),
                ('team', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='mainapp.Team')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mday', models.IntegerField(default=None, null=True)),
                ('round', models.CharField(default=None, max_length=100, null=True)),
                ('leg', models.IntegerField(choices=[(0, mainapp.models.LegChoice['EMPTY']), (1, mainapp.models.LegChoice['FIRST']), (2, mainapp.models.LegChoice['SECOND']), (3, mainapp.models.LegChoice['REPLAY'])], default=None, null=True)),
                ('sign', models.CharField(max_length=1000, unique=True)),
                ('base_url', models.CharField(default=None, max_length=200, null=True)),
                ('score_url', models.CharField(default=None, max_length=200, null=True)),
                ('live_url', models.CharField(default=None, max_length=200, null=True)),
                ('tv_channels', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, null=True, size=None)),
                ('mday_id', models.IntegerField(default=None, null=True)),
                ('status', models.IntegerField(choices=[(1, mainapp.models.StatusChoice['FIRST_TIME']), (2, mainapp.models.StatusChoice['HALF_TIME']), (3, mainapp.models.StatusChoice['SECOND_TIME']), (4, mainapp.models.StatusChoice['FIRST_EXTRA']), (5, mainapp.models.StatusChoice['HALF_EXTRA']), (6, mainapp.models.StatusChoice['SECOND_EXTRA']), (7, mainapp.models.StatusChoice['SHOOTOUT']), (8, mainapp.models.StatusChoice['WAIT_SCORES']), (9, mainapp.models.StatusChoice['OVER']), (10, mainapp.models.StatusChoice['POSTPONED']), (11, mainapp.models.StatusChoice['CANCELLED'])], default=None, null=True)),
                ('minute', models.CharField(default=None, max_length=10, null=True)),
                ('start_date', models.DateTimeField(default=None, null=True)),
                ('end_date', models.DateTimeField(default=None, null=True)),
                ('home_score', models.IntegerField(default=None, null=True)),
                ('away_score', models.IntegerField(default=None, null=True)),
                ('sets_score', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('winner', models.IntegerField(choices=[(1, mainapp.models.WinnerChoice['HOME']), (2, mainapp.models.WinnerChoice['AWAY']), (3, mainapp.models.WinnerChoice['DRAW'])], default=None, null=True)),
                ('extra_time', models.IntegerField(choices=[(1, mainapp.models.ExtraTimeChoice['EXTRA_TIME']), (2, mainapp.models.ExtraTimeChoice['SHOOTOUT'])], default=None, null=True)),
                ('shootout_home', models.IntegerField(default=None, null=True)),
                ('shootout_away', models.IntegerField(default=None, null=True)),
                ('squad', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('events', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('stats', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('live', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('last_event', django.contrib.postgres.fields.jsonb.JSONField(default=None, null=True)),
                ('last_event_date', models.DateTimeField(default=None, null=True)),
                ('error', models.CharField(default=None, max_length=100, null=True)),
                ('trace', models.CharField(default=None, max_length=1000, null=True)),
                ('league', mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.League')),
                ('player_away', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pa', to='mainapp.Player')),
                ('player_home', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ph', to='mainapp.Player')),
                ('team_away', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ta', to='mainapp.Team')),
                ('team_home', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='th', to='mainapp.Team')),
            ],
            bases=(mainapp.models.MainappModel, models.Model),
        ),
        migrations.AddField(
            model_name='league',
            name='sport',
            field=mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Sport'),
        ),
        migrations.AddConstraint(
            model_name='team',
            constraint=models.UniqueConstraint(fields=('sport', 'name', 'gender'), name='custom_unique_team'),
        ),
        migrations.AddConstraint(
            model_name='source',
            constraint=models.UniqueConstraint(fields=('sport', 'name'), name='custom_unique_source'),
        ),
        migrations.AddConstraint(
            model_name='league',
            constraint=models.UniqueConstraint(fields=('sport', 'name', 'gender'), name='custom_unique_league'),
        ),
    ]
