# Generated by Django 3.1 on 2020-08-22 03:23

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=datetime.datetime.now)),
                ('Team1logo', models.ImageField(default=0, upload_to='images/match', verbose_name='Team1 logo')),
                ('Team2logo', models.ImageField(default=0, upload_to='images/match', verbose_name='Team2 logo')),
                ('League', models.CharField(default=0, max_length=100)),
                ('Elected_to', models.CharField(choices=[('Bat', 'Bat'), ('Bat', 'Bowl')], max_length=100)),
            ],
            options={
                'db_table': 'match',
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('identifier', models.IntegerField(primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('player_image', models.ImageField(upload_to='images/players')),
                ('player_jersy_number', models.IntegerField()),
                ('country', models.CharField(max_length=40)),
            ],
            options={
                'db_table': 'player',
            },
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('identifier', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('logo_url', models.ImageField(upload_to='images/team')),
                ('club_state', models.CharField(max_length=70)),
            ],
            options={
                'db_table': 'team',
            },
        ),
        migrations.CreateModel(
            name='Score',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('team1Score', models.IntegerField(default=0)),
                ('team2Score', models.IntegerField(default=0)),
                ('Team1', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='teamA', to='Blog.team')),
                ('Team2', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='teamB', to='Blog.team')),
                ('matches_between', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fixture_between', to='Blog.match')),
            ],
            options={
                'db_table': 'score',
            },
        ),
        migrations.CreateModel(
            name='Player_history',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('matches', models.IntegerField()),
                ('run', models.IntegerField()),
                ('highest_score', models.IntegerField()),
                ('fifties', models.IntegerField()),
                ('hundreds', models.IntegerField()),
                ('player', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='Blog.player')),
            ],
            options={
                'db_table': 'player_history',
            },
        ),
        migrations.AddField(
            model_name='player',
            name='team',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='team', to='Blog.team'),
        ),
        migrations.AddField(
            model_name='match',
            name='Team1',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='team1', to='Blog.team'),
        ),
        migrations.AddField(
            model_name='match',
            name='Team2',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='team2', to='Blog.team'),
        ),
        migrations.AddField(
            model_name='match',
            name='Toss_won_by',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='tosswon', to='Blog.team'),
        ),
    ]
