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

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        (
            "hedge",
            "0003_rename_hedge_portf_pair_id_e7f44b_idx_hedge_portf_pair_id_6d9fd6_idx_and_more",
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[],
            state_operations=[
        migrations.CreateModel(
            name="HedgingInstrumentConfigModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "instrument_code",
                    models.CharField(max_length=50, unique=True, verbose_name="工具代码"),
                ),
                ("instrument_name", models.CharField(max_length=100, verbose_name="工具名称")),
                (
                    "instrument_type",
                    models.CharField(
                        choices=[
                            ("futures", "期货"),
                            ("options", "期权"),
                            ("inverse_etf", "反向ETF"),
                            ("cash", "现金"),
                        ],
                        max_length=20,
                        verbose_name="工具类型",
                    ),
                ),
                (
                    "hedge_ratio",
                    models.FloatField(
                        default=1.0,
                        help_text="如 0.95 表示需要对冲95%的敞口",
                        verbose_name="对冲比例",
                    ),
                ),
                (
                    "underlying_index",
                    models.CharField(
                        blank=True,
                        help_text="如 000300.SH 表示沪深300",
                        max_length=50,
                        verbose_name="标的指数",
                    ),
                ),
                (
                    "cost_bps",
                    models.FloatField(
                        default=5.0, help_text="如 5 表示 0.05%", verbose_name="对冲成本（基点）"
                    ),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="是否启用")),
                ("notes", 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": "hedging_instrument_config",
                "indexes": [
                    models.Index(
                        fields=["instrument_type", "is_active"],
                        name="hedging_ins_instrum_f5ba64_idx",
                    )
                ],
            },
        ),
            ],
        ),
    ]
