# Generated by Django 5.0.6 on 2024-08-13 09:11
import django.contrib.postgres.fields.ranges
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("example_app", "0005_sportperson_profile_image"),
    ]

    operations = [
        migrations.CreateModel(
            name="Season",
            options={"verbose_name": "Season", "verbose_name_plural": "Seasons"},
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("date_range", django.contrib.postgres.fields.ranges.DateRangeField()),
                ("name", models.CharField(blank=True, max_length=255)),
                ("file", models.FileField(blank=True, null=True, upload_to="season_files/")),
                (
                    "league",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="seasons", to="example_app.league"
                    ),
                ),
                (
                    "top_scorer",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="top_scorer_seasons",
                        to="example_app.player",
                    ),
                ),
                (
                    "winner",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="won_seasons",
                        to="example_app.team",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="player",
            name="is_active",
            field=models.BooleanField(default=True, verbose_name="Is Active"),
        ),
        migrations.AddField(
            model_name="player",
            name="is_injured",
            field=models.BooleanField(default=False, verbose_name="Is Injured"),
        ),
        migrations.AddField(
            model_name="player",
            name="player_strength",
            field=models.IntegerField(
                default=3,
                validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(5)],
                verbose_name="Player Strength",
            ),
        ),
        migrations.AddField(
            model_name="player",
            name="game_activity",
            field=models.FloatField(
                default=0,
                validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)],
                verbose_name="Game Activity",
            ),
        ),
        migrations.AddField(
            model_name="stadium",
            name="guest_rating",
            field=models.IntegerField(
                default=3,
                validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(4)],
                verbose_name="Guest Rating",
            ),
        ),
        migrations.AddField(
            model_name="team",
            name="phone_number",
            field=models.CharField(blank=True, max_length=255, null=True, verbose_name="Phone Number"),
        ),
        migrations.AddField(
            model_name="team",
            name="email",
            field=models.EmailField(blank=True, max_length=254, null=True, verbose_name="Email Address"),
        ),
        migrations.AddField(
            model_name="team",
            name="duration_since_last_win",
            field=models.DurationField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name="event",
            name="event_description",
            field=models.TextField(blank=True, max_length=512, null=True, verbose_name="Event Description"),
        ),
        migrations.AddField(
            model_name="match",
            name="winner",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="won_matches",
                to="example_app.team",
            ),
        ),
    ]
