# Generated by Django 5.2.12 on 2026-04-26 23:34

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("filter", "0001_initial"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[],
            state_operations=[
        migrations.CreateModel(
            name="FilterParameterConfigModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        help_text="如 hp_monthly, kalman_macro 等",
                        max_length=100,
                        unique=True,
                        verbose_name="参数键",
                    ),
                ),
                ("name", models.CharField(max_length=100, verbose_name="参数名称")),
                (
                    "filter_type",
                    models.CharField(
                        choices=[
                            ("hp", "HP 滤波"),
                            ("kalman", "Kalman 滤波"),
                            ("ma", "移动平均"),
                            ("other", "其他"),
                        ],
                        max_length=20,
                        verbose_name="滤波类型",
                    ),
                ),
                (
                    "parameters",
                    models.JSONField(
                        help_text="如 {'lambda': 129600} 或 {'level_variance': 0.05}",
                        verbose_name="滤波参数",
                    ),
                ),
                (
                    "data_frequency",
                    models.CharField(
                        blank=True,
                        help_text="D/W/M/Q/Y，留空表示不限",
                        max_length=10,
                        verbose_name="数据频率",
                    ),
                ),
                (
                    "indicator_category",
                    models.CharField(
                        blank=True,
                        help_text="growth/inflation/等",
                        max_length=20,
                        verbose_name="适用指标分类",
                    ),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="是否启用")),
                ("description", models.TextField(blank=True, verbose_name="描述")),
                ("created_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")),
                ("updated_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")),
            ],
            options={
                "verbose_name": "滤波参数配置",
                "verbose_name_plural": "滤波参数配置",
                "db_table": "filter_parameter_config",
            },
        ),
            ],
        ),
    ]
