# Generated by Django 4.2.27 on 2026-02-06 15:49

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("yonghu", "0020_adminprofile_yaoqingma"),
    ]

    operations = [
        migrations.CreateModel(
            name="RankingRecord",
            fields=[
                (
                    "id",
                    models.AutoField(
                        primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "zhouqi",
                    models.IntegerField(
                        choices=[(1, "日榜"), (2, "月榜")], verbose_name="周期类型"
                    ),
                ),
                (
                    "tongji_date",
                    models.DateField(db_index=True, verbose_name="统计日期"),
                ),
                (
                    "shenfen",
                    models.IntegerField(
                        choices=[(2, "打手"), (3, "管事"), (4, "商家")],
                        verbose_name="用户身份",
                    ),
                ),
                (
                    "yonghuid",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="用户ID"
                    ),
                ),
                ("paiming", models.IntegerField(verbose_name="排名")),
                (
                    "zhizhi",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="指标值",
                    ),
                ),
                (
                    "nicheng",
                    models.CharField(max_length=50, null=True, verbose_name="用户昵称"),
                ),
                (
                    "avatar",
                    models.CharField(
                        blank=True, max_length=500, null=True, verbose_name="头像"
                    ),
                ),
                (
                    "chuangjian_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
            ],
            options={
                "verbose_name": "排行榜记录",
                "verbose_name_plural": "排行榜记录",
                "db_table": "ranking_record",
                "indexes": [
                    models.Index(
                        fields=["zhouqi", "tongji_date", "shenfen", "paiming"],
                        name="ranking_rec_zhouqi_fc9f4d_idx",
                    ),
                    models.Index(
                        fields=["yonghuid", "zhouqi"],
                        name="ranking_rec_yonghui_e5be77_idx",
                    ),
                    models.Index(
                        fields=["tongji_date"], name="ranking_rec_tongji__820158_idx"
                    ),
                ],
                "unique_together": {("zhouqi", "tongji_date", "shenfen", "paiming")},
            },
        ),
    ]
