# Generated by Django 5.2.9 on 2026-01-05 00:07

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


class Migration(migrations.Migration):

    dependencies = [
        (
            "simulated_trading",
            "0002_rename_fee_config_asset_idx_simulated_f_asset_t_e1e211_idx_and_more",
        ),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="simulatedaccountmodel",
            options={
                "ordering": ["-created_at"],
                "verbose_name": "投资组合账户",
                "verbose_name_plural": "投资组合账户",
            },
        ),
        migrations.AddField(
            model_name="simulatedaccountmodel",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="investment_accounts",
                to=settings.AUTH_USER_MODEL,
                verbose_name="用户",
            ),
        ),
        migrations.AlterField(
            model_name="simulatedaccountmodel",
            name="account_name",
            field=models.CharField(max_length=100, verbose_name="账户名称"),
        ),
        migrations.AlterField(
            model_name="simulatedaccountmodel",
            name="account_type",
            field=models.CharField(
                choices=[("real", "实仓"), ("simulated", "模拟仓")],
                db_index=True,
                default="simulated",
                max_length=20,
                verbose_name="账户类型",
            ),
        ),
        migrations.AddIndex(
            model_name="simulatedaccountmodel",
            index=models.Index(
                fields=["user", "-created_at"], name="simulated_a_user_id_3f7669_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="simulatedaccountmodel",
            index=models.Index(
                fields=["user", "account_type"], name="simulated_a_user_id_d9790d_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="simulatedaccountmodel",
            index=models.Index(fields=["user", "is_active"], name="simulated_a_user_id_61b403_idx"),
        ),
    ]
