# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-12 10:43
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('multidb_account', '0044_add_id_organisation'),
    ]

    operations = [
        migrations.CreateModel(
            name='SportEngineEvent',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('sport_engine_id', models.PositiveIntegerField(primary_key=True, serialize=False, verbose_name='sport engine id')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
                ('athletes', models.ManyToManyField(blank=True, related_name='sport_engine_events', to='multidb_account.AthleteUser')),
            ],
            options={
                'verbose_name_plural': 'events',
                'db_table': 'sport_engine_event',
            },
        ),
        migrations.CreateModel(
            name='SportEngineGame',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('sport_engine_id', models.PositiveIntegerField(primary_key=True, serialize=False, verbose_name='sport engine id')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
                ('athletes', models.ManyToManyField(blank=True, related_name='sport_engine_games', to='multidb_account.AthleteUser')),
            ],
            options={
                'verbose_name_plural': 'games',
                'db_table': 'sport_engine_game',
            },
        ),
        migrations.CreateModel(
            name='SportEngineTeam',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('sport_engine_id', models.PositiveIntegerField(primary_key=True, serialize=False, verbose_name='sport engine id')),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
                ('team', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sport_engine_team', to='multidb_account.Team')),
            ],
            options={
                'verbose_name_plural': 'teams',
                'db_table': 'sport_engine_team',
            },
        ),
        migrations.AddField(
            model_name='sportenginegame',
            name='sport_engine_teams',
            field=models.ManyToManyField(related_name='sport_engine_games', to='sport_engine.SportEngineTeam'),
        ),
        migrations.AddField(
            model_name='sportengineevent',
            name='sport_engine_game',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sport_engine_events', to='sport_engine.SportEngineGame'),
        ),
        migrations.AddField(
            model_name='sportengineevent',
            name='sport_engine_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sport_engine_events', to='sport_engine.SportEngineTeam'),
        ),
    ]
