# Generated by Django 6.0.1 on 2026-01-28 10:18

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AdminUser",
            fields=[
                ("password", models.CharField(max_length=128, verbose_name="password")),
                (
                    "last_login",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="last login"
                    ),
                ),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "username",
                    models.CharField(max_length=50, unique=True, verbose_name="用户名"),
                ),
                (
                    "name",
                    models.CharField(
                        blank=True, default="", max_length=50, verbose_name="姓名"
                    ),
                ),
                (
                    "email",
                    models.EmailField(
                        blank=True, default="", max_length=254, verbose_name="邮箱"
                    ),
                ),
                (
                    "phone",
                    models.CharField(
                        blank=True, default="", max_length=20, verbose_name="手机号"
                    ),
                ),
                (
                    "role",
                    models.CharField(
                        choices=[
                            ("super_admin", "超级管理员"),
                            ("admin", "管理员"),
                            ("operator", "操作员"),
                        ],
                        default="operator",
                        max_length=20,
                        verbose_name="角色",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(default=True, verbose_name="是否启用"),
                ),
                (
                    "last_login_ip",
                    models.GenericIPAddressField(
                        blank=True, null=True, verbose_name="最后登录IP"
                    ),
                ),
                (
                    "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": "admin_user",
            },
        ),
    ]
