"""chore:remove old models

Revision ID: d2c6607d312a
Revises: 9cd63aabeae8
Create Date: 2025-09-08 06:26:04.420085

"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = "d2c6607d312a"
down_revision = "9cd63aabeae8"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("admin_info")
    op.drop_table("discount")
    op.drop_table("discount_record")
    op.drop_table("ai_course_lesson_attend_association")
    with op.batch_alter_table("ai_course_lesson_attendscript", schema=None) as batch_op:
        batch_op.drop_index("ix_ai_course_lesson_attendscript_attend_id")
        batch_op.drop_index("ix_ai_course_lesson_attendscript_course_id")
        batch_op.drop_index("ix_ai_course_lesson_attendscript_lesson_id")
        batch_op.drop_index("ix_ai_course_lesson_attendscript_log_id")
        batch_op.drop_index("ix_ai_course_lesson_attendscript_script_id")
        batch_op.drop_index("ix_ai_course_lesson_attendscript_user_id")

    op.drop_table("ai_course_lesson_attendscript")
    op.drop_table("pingxx_order")
    with op.batch_alter_table("ai_course_buy_record", schema=None) as batch_op:
        batch_op.drop_index("ix_ai_course_buy_record_course_id")
        batch_op.drop_index("ix_ai_course_buy_record_record_id")
        batch_op.drop_index("ix_ai_course_buy_record_user_id")

    op.drop_table("ai_course_buy_record")
    with op.batch_alter_table("ai_course_lesson_attend", schema=None) as batch_op:
        batch_op.drop_index("ix_ai_course_lesson_attend_attend_id")
        batch_op.drop_index("ix_ai_course_lesson_attend_course_id")
        batch_op.drop_index("ix_ai_course_lesson_attend_lesson_id")
        batch_op.drop_index("ix_ai_course_lesson_attend_lesson_unique_id")
        batch_op.drop_index("ix_ai_course_lesson_attend_script_unique_id")
        batch_op.drop_index("ix_ai_course_lesson_attend_status")
        batch_op.drop_index("ix_ai_course_lesson_attend_user_id")

    op.drop_table("ai_course_lesson_attend")
    with op.batch_alter_table("order_banner_info", schema=None) as batch_op:
        batch_op.alter_column(
            "id",
            existing_type=mysql.BIGINT(),
            comment=None,
            existing_comment="Unique ID",
            existing_nullable=False,
            autoincrement=True,
        )
        batch_op.alter_column(
            "banner_id",
            existing_type=mysql.VARCHAR(length=36),
            comment="Banner identifier",
            existing_comment="Banner ID",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "course_id",
            existing_type=mysql.VARCHAR(length=36),
            comment="Course identifier",
            existing_comment="Course ID",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "created_at",
            existing_type=mysql.DATETIME(),
            comment="Creation time",
            existing_comment="Creation timestamp",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "updated_at",
            existing_type=mysql.DATETIME(),
            comment="Update time",
            existing_comment="Last update timestamp",
            existing_nullable=False,
        )
        batch_op.create_table_comment("Order banner info", existing_comment=None)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("order_banner_info", schema=None) as batch_op:
        batch_op.drop_table_comment(existing_comment="Order banner info")
        batch_op.alter_column(
            "updated_at",
            existing_type=mysql.DATETIME(),
            comment="Last update timestamp",
            existing_comment="Update time",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "created_at",
            existing_type=mysql.DATETIME(),
            comment="Creation timestamp",
            existing_comment="Creation time",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "course_id",
            existing_type=mysql.VARCHAR(length=36),
            comment="Course ID",
            existing_comment="Course identifier",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "banner_id",
            existing_type=mysql.VARCHAR(length=36),
            comment="Banner ID",
            existing_comment="Banner identifier",
            existing_nullable=False,
        )
        batch_op.alter_column(
            "id",
            existing_type=mysql.BIGINT(),
            comment="Unique ID",
            existing_nullable=False,
            autoincrement=True,
        )

    with op.batch_alter_table("active", schema=None) as batch_op:
        batch_op.alter_column(
            "updated",
            existing_type=mysql.TIMESTAMP(),
            server_default=sa.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"),
            existing_comment="Update time",
            existing_nullable=False,
        )

    op.create_table(
        "ai_course_lesson_attend",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "attend_id", mysql.VARCHAR(length=36), nullable=False, comment="Attend UUID"
        ),
        sa.Column(
            "lesson_id", mysql.VARCHAR(length=36), nullable=False, comment="Lesson UUID"
        ),
        sa.Column(
            "course_id", mysql.VARCHAR(length=36), nullable=False, comment="Course UUID"
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the attend: 0-not started, 1-in progress, 2-completed",
        ),
        sa.Column(
            "script_index",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the attend: 0-not started, 1-in progress, 2-completed",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.Column(
            "lesson_no", mysql.VARCHAR(length=36), nullable=False, comment="Lesson no"
        ),
        sa.Column(
            "lesson_updated",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Lesson is  updated",
        ),
        sa.Column(
            "lesson_unique_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Lesson unique ID",
        ),
        sa.Column(
            "script_unique_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Script unique ID",
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("ai_course_lesson_attend", schema=None) as batch_op:
        batch_op.create_index(
            "ix_ai_course_lesson_attend_user_id", ["user_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_status", ["status"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_script_unique_id",
            ["script_unique_id"],
            unique=False,
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_lesson_unique_id",
            ["lesson_unique_id"],
            unique=False,
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_lesson_id", ["lesson_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_course_id", ["course_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attend_attend_id", ["attend_id"], unique=False
        )

    op.create_table(
        "ai_course_buy_record",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "record_id", mysql.VARCHAR(length=36), nullable=False, comment="Record UUID"
        ),
        sa.Column(
            "course_id", mysql.VARCHAR(length=36), nullable=False, comment="Course UUID"
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "price",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Price of the course",
        ),
        sa.Column(
            "pay_value",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Payment value",
        ),
        sa.Column(
            "discount_value",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Discount value",
        ),
        sa.Column(
            "paid_value",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Paid value",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the record",
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("ai_course_buy_record", schema=None) as batch_op:
        batch_op.create_index(
            "ix_ai_course_buy_record_user_id", ["user_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_buy_record_record_id", ["record_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_buy_record_course_id", ["course_id"], unique=False
        )

    op.create_table(
        "pingxx_order",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "order_id", mysql.VARCHAR(length=36), nullable=False, comment="Order UUID"
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "course_id", mysql.VARCHAR(length=36), nullable=False, comment="Course UUID"
        ),
        sa.Column(
            "record_id", mysql.VARCHAR(length=36), nullable=False, comment="Record UUID"
        ),
        sa.Column(
            "pingxx_transaction_no",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Pingxx transaction number",
        ),
        sa.Column(
            "pingxx_app_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Pingxx app ID",
        ),
        sa.Column(
            "pingxx_channel",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Payment channel",
        ),
        sa.Column(
            "pingxx_id", mysql.VARCHAR(length=36), nullable=False, comment="Pingxx ID"
        ),
        sa.Column(
            "channel",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Payment channel",
        ),
        sa.Column(
            "amount",
            mysql.BIGINT(),
            autoincrement=False,
            nullable=False,
            comment="Payment amount",
        ),
        sa.Column("extra", mysql.TEXT(), nullable=False, comment="Extra information"),
        sa.Column(
            "currency", mysql.VARCHAR(length=36), nullable=False, comment="Currency"
        ),
        sa.Column(
            "subject",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Payment subject",
        ),
        sa.Column(
            "body", mysql.VARCHAR(length=255), nullable=False, comment="Payment body"
        ),
        sa.Column(
            "order_no",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Order number",
        ),
        sa.Column(
            "client_ip", mysql.VARCHAR(length=255), nullable=False, comment="Client IP"
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the order: 0-unpaid, 1-paid, 2-refunded, 3-closed, 4-failed",
        ),
        sa.Column(
            "charge_id", mysql.VARCHAR(length=255), nullable=False, comment="Charge ID"
        ),
        sa.Column("paid_at", mysql.TIMESTAMP(), nullable=False, comment="Payment time"),
        sa.Column(
            "refunded_at", mysql.TIMESTAMP(), nullable=False, comment="Refund time"
        ),
        sa.Column("closed_at", mysql.TIMESTAMP(), nullable=False, comment="Close time"),
        sa.Column(
            "failed_at", mysql.TIMESTAMP(), nullable=False, comment="Failed time"
        ),
        sa.Column(
            "refund_id", mysql.VARCHAR(length=255), nullable=False, comment="Refund ID"
        ),
        sa.Column(
            "failure_code",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Failure code",
        ),
        sa.Column(
            "failure_msg",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Failure message",
        ),
        sa.Column(
            "charge_object", mysql.TEXT(), nullable=False, comment="Charge object"
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("pingxx_order", schema=None) as batch_op:
        batch_op.create_index("ix_pingxx_order_user_id", ["user_id"], unique=False)
        batch_op.create_index("ix_pingxx_order_record_id", ["record_id"], unique=False)
        batch_op.create_index(
            "ix_pingxx_order_pingxx_transaction_no",
            ["pingxx_transaction_no"],
            unique=False,
        )
        batch_op.create_index(
            "ix_pingxx_order_pingxx_app_id", ["pingxx_app_id"], unique=False
        )
        batch_op.create_index("ix_pingxx_order_order_id", ["order_id"], unique=False)
        batch_op.create_index("ix_pingxx_order_course_id", ["course_id"], unique=False)

    op.create_table(
        "ai_course_lesson_attendscript",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "log_id", mysql.VARCHAR(length=36), nullable=False, comment="Log UUID"
        ),
        sa.Column(
            "attend_id", mysql.VARCHAR(length=36), nullable=False, comment="Attend UUID"
        ),
        sa.Column(
            "script_id", mysql.VARCHAR(length=36), nullable=False, comment="Script UUID"
        ),
        sa.Column(
            "lesson_id", mysql.VARCHAR(length=36), nullable=False, comment="Lesson UUID"
        ),
        sa.Column(
            "course_id", mysql.VARCHAR(length=36), nullable=False, comment="Course UUID"
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "script_index",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Script index",
        ),
        sa.Column(
            "script_role",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Script role",
        ),
        sa.Column(
            "script_content", mysql.TEXT(), nullable=False, comment="Script content"
        ),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the attend",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.Column(
            "script_ui_conf", mysql.TEXT(), nullable=False, comment="Script UI Config"
        ),
        sa.Column(
            "script_ui_type",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Script UI type",
        ),
        sa.Column(
            "interaction_type",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Interaction type: 0-no interaction, 1-like, 2-dislike",
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("ai_course_lesson_attendscript", schema=None) as batch_op:
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_user_id", ["user_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_script_id", ["script_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_log_id", ["log_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_lesson_id", ["lesson_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_course_id", ["course_id"], unique=False
        )
        batch_op.create_index(
            "ix_ai_course_lesson_attendscript_attend_id", ["attend_id"], unique=False
        )

    op.create_table(
        "ai_course_lesson_attend_association",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "association_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Attend UUID",
        ),
        sa.Column(
            "from_attend_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Attend UUID",
        ),
        sa.Column(
            "to_attend_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Attend UUID",
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="Attend UUID"
        ),
        sa.Column(
            "association_status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the attend: 0-not started, 1-in progress, 2-completed",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    op.create_table(
        "discount_record",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "record_id", mysql.VARCHAR(length=36), nullable=False, comment="Record UUID"
        ),
        sa.Column(
            "discount_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount UUID",
        ),
        sa.Column(
            "discount_name",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Discount name",
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "course_id", mysql.VARCHAR(length=36), nullable=False, comment="Course UUID"
        ),
        sa.Column(
            "order_id", mysql.VARCHAR(length=36), nullable=False, comment="Order UUID"
        ),
        sa.Column(
            "discount_code",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount code",
        ),
        sa.Column(
            "discount_type",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Discount type: 0-percent, 1-amount",
        ),
        sa.Column(
            "discount_value",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Discount value",
        ),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the record: 0-inactive, 1-active",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column("updated", mysql.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("discount_record", schema=None) as batch_op:
        batch_op.create_index("ix_discount_record_user_id", ["user_id"], unique=False)
        batch_op.create_index(
            "ix_discount_record_record_id", ["record_id"], unique=False
        )
        batch_op.create_index("ix_discount_record_order_id", ["order_id"], unique=False)
        batch_op.create_index(
            "ix_discount_record_discount_id", ["discount_id"], unique=False
        )
        batch_op.create_index(
            "ix_discount_record_course_id", ["course_id"], unique=False
        )

    op.create_table(
        "discount",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "discount_id",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount UUID",
        ),
        sa.Column(
            "discount_code",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount code",
        ),
        sa.Column(
            "discount_type",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Discount type: 701-fixed, 702-percent",
        ),
        sa.Column(
            "discount_apply_type",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Discount apply type: 801-all, 802-specific",
        ),
        sa.Column(
            "discount_value",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Discount value",
        ),
        sa.Column(
            "discount_limit",
            mysql.DECIMAL(precision=10, scale=2),
            nullable=False,
            comment="Discount limit",
        ),
        sa.Column(
            "discount_start",
            mysql.TIMESTAMP(),
            nullable=False,
            comment="Discount start time",
        ),
        sa.Column(
            "discount_end",
            mysql.TIMESTAMP(),
            nullable=False,
            comment="Discount end time",
        ),
        sa.Column(
            "discount_channel",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount channel",
        ),
        sa.Column(
            "discount_filter", mysql.TEXT(), nullable=False, comment="Discount filter"
        ),
        sa.Column(
            "discount_count",
            mysql.BIGINT(),
            autoincrement=False,
            nullable=False,
            comment="Discount count",
        ),
        sa.Column(
            "discount_used",
            mysql.BIGINT(),
            autoincrement=False,
            nullable=False,
            comment="Discount used",
        ),
        sa.Column(
            "discount_generated_user",
            mysql.VARCHAR(length=36),
            nullable=False,
            comment="Discount generated user",
        ),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column(
            "updated",
            mysql.TIMESTAMP(),
            server_default=sa.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"),
            nullable=False,
            comment="Update time",
        ),
        sa.Column(
            "status",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=False,
            comment="Status of the discount: 0-inactive, 1-active",
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    with op.batch_alter_table("discount", schema=None) as batch_op:
        batch_op.create_index("ix_discount_discount_id", ["discount_id"], unique=False)
        batch_op.create_index(
            "ix_discount_discount_code", ["discount_code"], unique=False
        )

    op.create_table(
        "admin_info",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column(
            "user_id", mysql.VARCHAR(length=36), nullable=False, comment="User UUID"
        ),
        sa.Column(
            "username",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Login username",
        ),
        sa.Column(
            "name", mysql.VARCHAR(length=255), nullable=False, comment="User real name"
        ),
        sa.Column(
            "password_hash",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Hashed password",
        ),
        sa.Column("email", mysql.VARCHAR(length=255), nullable=False, comment="Email"),
        sa.Column("mobile", mysql.VARCHAR(length=20), nullable=False, comment="Mobile"),
        sa.Column(
            "created", mysql.TIMESTAMP(), nullable=False, comment="Creation time"
        ),
        sa.Column(
            "updated",
            mysql.TIMESTAMP(),
            server_default=sa.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"),
            nullable=False,
            comment="Update time",
        ),
        sa.Column(
            "default_model",
            mysql.VARCHAR(length=255),
            nullable=False,
            comment="Default model",
        ),
        sa.Column(
            "user_state",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=True,
            comment="User_state",
        ),
        sa.Column(
            "user_sex",
            mysql.INTEGER(),
            autoincrement=False,
            nullable=True,
            comment="user sex",
        ),
        sa.Column("user_birth", sa.DATE(), nullable=True, comment="user birth"),
        sa.Column(
            "user_avatar",
            mysql.VARCHAR(length=255),
            nullable=True,
            comment="user avatar",
        ),
        sa.Column(
            "user_language",
            mysql.VARCHAR(length=30),
            nullable=True,
            comment="user language",
        ),
        sa.PrimaryKeyConstraint("id"),
        mysql_collate="utf8mb4_0900_ai_ci",
        mysql_default_charset="utf8mb4",
        mysql_engine="InnoDB",
    )
    # ### end Alembic commands ###
