# Generated by Django 5.2.9 on 2026-01-14 07:04

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("macro", "0008_alter_macroindicator_value"),
    ]

    operations = [
        migrations.CreateModel(
            name="DataProviderSettings",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "default_data_source",
                    models.CharField(
                        choices=[
                            ("akshare", "AKShare（推荐）"),
                            ("tushare", "Tushare Pro"),
                            ("failover", "自动容错（AKShare→Tushare）"),
                        ],
                        default="akshare",
                        help_text="默认数据源选择",
                        max_length=20,
                    ),
                ),
                (
                    "enable_failover",
                    models.BooleanField(
                        default=True, help_text="启用自动容错切换（主数据源失败时自动切换备用源）"
                    ),
                ),
                (
                    "failover_tolerance",
                    models.FloatField(
                        default=0.01, help_text="容差比例（0.01=1%），用于校验主备数据源一致性"
                    ),
                ),
                ("description", models.TextField(blank=True, help_text="配置说明")),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
            ],
            options={
                "verbose_name": "数据源设置",
                "verbose_name_plural": "数据源设置",
                "db_table": "data_provider_settings",
            },
        ),
    ]
