"""user_verify_code

Revision ID: 1fd178d512f2
Revises: 2e90df860a64
Create Date: 2025-05-16 02:05:17.484842

"""

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

# revision identifiers, used by Alembic.
revision = "1fd178d512f2"
down_revision = "2e90df860a64"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "user_verify_code",
        sa.Column(
            "id",
            mysql.BIGINT(),
            autoincrement=True,
            nullable=False,
            comment="Unique ID",
        ),
        sa.Column("phone", sa.String(length=36), nullable=False, comment="User phone"),
        sa.Column("mail", sa.String(length=36), nullable=False, comment="User mail"),
        sa.Column(
            "verify_code", sa.String(length=10), nullable=False, comment="Verify code"
        ),
        sa.Column(
            "verify_code_type", sa.Integer(), nullable=False, comment="Verify code type"
        ),
        sa.Column(
            "verify_code_send",
            sa.Integer(),
            nullable=False,
            comment="verification code send state",
        ),
        sa.Column(
            "verify_code_used",
            sa.Integer(),
            nullable=False,
            comment="verification code used state",
        ),
        sa.Column("user_ip", sa.String(length=100), nullable=False, comment="user ip"),
        sa.Column("created", sa.TIMESTAMP(), nullable=False, comment="Creation time"),
        sa.Column("updated", sa.TIMESTAMP(), nullable=False, comment="Update time"),
        sa.PrimaryKeyConstraint("id"),
    )

    # ### end Alembic commands ###


def downgrade():
    op.drop_table("user_verify_code")
    # ### end Alembic commands ###
