# Generated by Django 5.0.8 on 2024-09-16 13:56

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


class Migration(migrations.Migration):

    dependencies = [
        ('ixp_tracker', '0004_ixpmember_ixpmember_unique_ixp_membership'),
    ]

    operations = [
        migrations.CreateModel(
            name='StatsPerCountry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', models.CharField(max_length=2)),
                ('stats_date', models.DateField()),
                ('asn_count', models.IntegerField()),
                ('member_count', models.IntegerField()),
                ('asns_ixp_member_rate', models.FloatField()),
                ('total_capacity', models.FloatField()),
            ],
            options={
                'verbose_name': 'Per-country stats',
            },
        ),
        migrations.CreateModel(
            name='StatsPerIXP',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stats_date', models.DateField()),
                ('capacity', models.FloatField()),
                ('members', models.IntegerField()),
                ('local_asns_members_rate', models.FloatField()),
            ],
            options={
                'verbose_name': 'IXP stats',
            },
        ),
        migrations.AddConstraint(
            model_name='statspercountry',
            constraint=models.UniqueConstraint(fields=('country', 'stats_date'), name='ixp_tracker_unique_per_country_stats'),
        ),
        migrations.AddField(
            model_name='statsperixp',
            name='ixp',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ixp_tracker.ixp'),
        ),
        migrations.AddConstraint(
            model_name='statsperixp',
            constraint=models.UniqueConstraint(fields=('ixp', 'stats_date'), name='ixp_tracker_unique_ixp_stats'),
        ),
    ]
