215 lines
16 KiB
Python
215 lines
16 KiB
Python
|
# Generated by Django 3.0.7 on 2020-10-01 14:45
|
||
|
|
||
|
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=False, null=True)),
|
||
|
('current_mday', models.IntegerField(default=False, null=True)),
|
||
|
('matches_by_mday', models.IntegerField(default=False, 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='Source',
|
||
|
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)),
|
||
|
('image_name', models.CharField(max_length=30, unique=True)),
|
||
|
('big_image_name', models.CharField(max_length=30, unique=True)),
|
||
|
('urls', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
|
||
|
('error', models.CharField(default=None, max_length=100, null=True)),
|
||
|
('trace', models.CharField(default=None, max_length=1000, null=True)),
|
||
|
],
|
||
|
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')),
|
||
|
],
|
||
|
options={
|
||
|
'unique_together': {('sport', 'name', 'gender'), ('sport', 'clean_name', 'gender')},
|
||
|
},
|
||
|
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')),
|
||
|
('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.AddField(
|
||
|
model_name='league',
|
||
|
name='sport',
|
||
|
field=mainapp.models.MainappForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Sport'),
|
||
|
),
|
||
|
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)),
|
||
|
('mday_id', models.IntegerField(default=None, null=True)),
|
||
|
('round', models.CharField(default=None, max_length=100, null=True)),
|
||
|
('leg', models.IntegerField(choices=[(1, mainapp.models.LegChoice['FIRST']), (2, mainapp.models.LegChoice['SECOND']), (3, mainapp.models.LegChoice['REPLAY'])], default=None, null=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)),
|
||
|
('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')),
|
||
|
('p_away', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='p_away', to='mainapp.Player')),
|
||
|
('p_home', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='p_home', to='mainapp.Player')),
|
||
|
('t_away', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='t_away', to='mainapp.Team')),
|
||
|
('t_home', mainapp.models.MainappForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='t_home', to='mainapp.Team')),
|
||
|
],
|
||
|
options={
|
||
|
'unique_together': {('league', 't_home', 't_away', 'p_home', 'p_away', 'mday', 'round', 'leg')},
|
||
|
},
|
||
|
bases=(mainapp.models.MainappModel, models.Model),
|
||
|
),
|
||
|
migrations.AlterUniqueTogether(
|
||
|
name='league',
|
||
|
unique_together={('sport', 'name', 'gender'), ('sport', 'clean_name', 'gender')},
|
||
|
),
|
||
|
]
|