# Generated by Django 4.2.27 on 2026-02-07 18:08

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("yonghu", "0021_rankingrecord"),
    ]

    operations = [
        migrations.CreateModel(
            name="OfficialAccountUser",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "unionid",
                    models.CharField(
                        db_index=True, max_length=64, verbose_name="UnionID"
                    ),
                ),
                (
                    "official_openid",
                    models.CharField(
                        db_index=True,
                        max_length=64,
                        unique=True,
                        verbose_name="服务号OpenID",
                    ),
                ),
                (
                    "subscribe_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="关注时间"),
                ),
                (
                    "is_subscribed",
                    models.BooleanField(default=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": "official_account_user",
            },
        ),
        migrations.AddField(
            model_name="usermain",
            name="unionid",
            field=models.CharField(
                blank=True,
                db_index=True,
                max_length=64,
                null=True,
                verbose_name="微信UnionID",
            ),
        ),
    ]
