# Generated by Django 4.2 on 2026-02-09 06:31

from django.db import migrations, models


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name="SmsCode",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("phone", models.CharField(max_length=20, verbose_name="手机号")),
                ("code", models.CharField(max_length=6, verbose_name="验证码")),
                (
                    "is_used",
                    models.BooleanField(default=False, verbose_name="是否已使用"),
                ),
                ("expire_at", models.DateTimeField(verbose_name="过期时间")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
            ],
            options={
                "verbose_name": "短信验证码",
                "verbose_name_plural": "短信验证码",
                "db_table": "sms_code",
            },
        ),
        migrations.AddField(
            model_name="user",
            name="birthday",
            field=models.DateField(blank=True, null=True, verbose_name="生日"),
        ),
        migrations.AddField(
            model_name="user",
            name="deletion_requested_at",
            field=models.DateTimeField(
                blank=True, null=True, verbose_name="注销申请时间"
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="gender",
            field=models.CharField(
                choices=[("male", "男"), ("female", "女"), ("unknown", "未知")],
                default="unknown",
                max_length=10,
                verbose_name="性别",
            ),
        ),
        migrations.AddField(
            model_name="user",
            name="is_pending_deletion",
            field=models.BooleanField(default=False, verbose_name="是否待注销"),
        ),
        migrations.AddField(
            model_name="user",
            name="points",
            field=models.IntegerField(default=0, verbose_name="积分余额"),
        ),
        migrations.AddIndex(
            model_name="smscode",
            index=models.Index(
                fields=["phone", "code"], name="sms_code_phone_e54855_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="smscode",
            index=models.Index(
                fields=["expire_at"], name="sms_code_expire__6612d9_idx"
            ),
        ),
    ]
