# Generated by Django 3.0 on 2020-07-31 12:50

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


class Migration(migrations.Migration):

    dependencies = [
        ('bets', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Competition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('country', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datetime_match', models.DateTimeField(auto_now_add=True, null=True)),
                ('completed', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('country', models.CharField(max_length=255)),
            ],
        ),
        migrations.AddField(
            model_name='openbet',
            name='bet',
            field=models.CharField(choices=[('home_win', 'home_win'), ('away_win', 'away_win'), ('draw', 'draw')], default='none', max_length=10),
        ),
        migrations.AddField(
            model_name='openbet',
            name='datetime_bet',
            field=models.DateTimeField(auto_now_add=True, null=True),
        ),
        migrations.AddField(
            model_name='openbet',
            name='is_active',
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name='openbet',
            name='website',
            field=models.CharField(default=2, max_length=255),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='MatchResult',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('home_scored', models.IntegerField()),
                ('away_scored', models.IntegerField()),
                ('match', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='bets.Match')),
            ],
        ),
        migrations.AddField(
            model_name='match',
            name='away_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='away_team', to='bets.Team'),
        ),
        migrations.AddField(
            model_name='match',
            name='competition',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bets.Competition'),
        ),
        migrations.AddField(
            model_name='match',
            name='home_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='home_team', to='bets.Team'),
        ),
        migrations.CreateModel(
            name='CloseBet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('outcome', models.CharField(choices=[('won', 'won'), ('lost', 'lost')], default='none', max_length=10)),
                ('open_bet', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='bets.OpenBet')),
            ],
        ),
        migrations.AddField(
            model_name='openbet',
            name='match',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='bets.Match'),
            preserve_default=False,
        ),
    ]
