"""separate number inputs

Revision ID: a49eb857dc0e
Revises: 6d56cc05dc0d
Create Date: 2025-08-14 14:50:04.059908

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "a49eb857dc0e"
down_revision = "6d56cc05dc0d"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "number_input_float",
        sa.Column("value", sa.Float(), nullable=True),
        sa.Column("min_value", sa.Float(), nullable=True),
        sa.Column("max_value", sa.Float(), nullable=True),
        sa.Column("step", sa.Float(), nullable=True),
        sa.Column("placeholder", sa.Float(), nullable=True),
        sa.Column("id", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ["id"], ["public.number_input.id"], name=op.f("fk_number_input_float_id_number_input"), ondelete="CASCADE"
        ),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_number_input_float")),
        schema="public",
    )
    op.create_table(
        "number_input_int",
        sa.Column("value", sa.Integer(), nullable=True),
        sa.Column("min_value", sa.Integer(), nullable=True),
        sa.Column("max_value", sa.Integer(), nullable=True),
        sa.Column("step", sa.Integer(), nullable=True),
        sa.Column("placeholder", sa.Integer(), nullable=True),
        sa.Column("id", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ["id"], ["public.number_input.id"], name=op.f("fk_number_input_int_id_number_input"), ondelete="CASCADE"
        ),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_number_input_int")),
        schema="public",
    )
    op.drop_column("number_input", "min_value", schema="public")
    op.drop_column("number_input", "placeholder", schema="public")
    op.drop_column("number_input", "step", schema="public")
    op.drop_column("number_input", "value", schema="public")
    op.drop_column("number_input", "max_value", schema="public")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "number_input",
        sa.Column("max_value", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
        schema="public",
    )
    op.add_column(
        "number_input",
        sa.Column("value", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
        schema="public",
    )
    op.add_column(
        "number_input",
        sa.Column("step", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
        schema="public",
    )
    op.add_column(
        "number_input",
        sa.Column("placeholder", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
        schema="public",
    )
    op.add_column(
        "number_input",
        sa.Column("min_value", sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
        schema="public",
    )
    op.drop_table("number_input_int", schema="public")
    op.drop_table("number_input_float", schema="public")
    # ### end Alembic commands ###
