"""add netbox query search

Revision ID: 6d424d93a992
Revises: 3d5e55da5fe4
Create Date: 2025-08-12 09:55:42.333612

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "6d424d93a992"
down_revision = "3d5e55da5fe4"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "netbox_search_step",
        sa.Column(
            "query_type",
            sa.Enum("IPADDRESSES", "PREFIXES", "TENANTS", name="netboxquerytype"),
            nullable=False,
        ),
        sa.Column("id", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ["id"],
            ["public.step.id"],
            name=op.f("fk_netbox_search_step_id_step"),
            ondelete="CASCADE",
        ),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_netbox_search_step")),
        schema="public",
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("netbox_search_step", schema="public")
    # ### end Alembic commands ###
