# Generated by Django 5.2.6 on 2025-12-13 17:17

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Metric',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=50, unique=True)),
                ('name', models.CharField(max_length=100)),
                ('scope', models.CharField(choices=[('PLAYER', 'Player Metric'), ('TEAM', 'Team Metric')], max_length=10)),
                ('description', models.TextField(blank=True)),
                ('unit', models.CharField(blank=True, max_length=20)),
                ('order', models.IntegerField(default=0)),
                ('min_value', models.FloatField(blank=True, null=True)),
                ('max_value', models.FloatField(blank=True, null=True)),
                ('calculation_method', models.CharField(blank=True, max_length=100)),
                ('requires_annotation', models.BooleanField(default=True)),
                ('status', models.CharField(choices=[('ENABLED', 'Enabled'), ('DISABLED', 'Disabled'), ('DELETED', 'Deleted')], default='ENABLED', max_length=10)),
                ('created_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
                ('created_by_id', models.IntegerField(null=True)),
            ],
            options={
                'db_table': 'analytics_metric',
                'ordering': ['scope', 'order', 'name'],
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ProcessedMatchPlayerMetrics',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('match_id', models.IntegerField()),
                ('player_id', models.IntegerField()),
                ('minutes_played', models.FloatField()),
                ('metric_value', models.FloatField()),
                ('status', models.CharField(choices=[('ENABLED', 'Enabled'), ('DISABLED', 'Disabled'), ('DELETED', 'Deleted')], default='ENABLED', max_length=20)),
                ('calculated_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
                ('notes', models.TextField(blank=True)),
            ],
            options={
                'db_table': 'analytics_processedmatchplayermetrics',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='ProcessedMatchTeamMetrics',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('match_id', models.IntegerField()),
                ('team_id', models.IntegerField()),
                ('metric_value', models.FloatField()),
                ('status', models.CharField(choices=[('ENABLED', 'Enabled'), ('DISABLED', 'Disabled'), ('DELETED', 'Deleted')], default='ENABLED', max_length=20)),
                ('calculated_at', models.DateTimeField()),
                ('updated_at', models.DateTimeField()),
                ('notes', models.TextField(blank=True)),
            ],
            options={
                'db_table': 'analytics_processedmatchteammetrics',
                'managed': False,
            },
        ),
    ]
