"""soft delete setting versions

Revision ID: 83d01e7ad41c
Revises: 9d3d34fcf6b4
Create Date: 2025-11-05 14:04:11.491372

"""

import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

from alembic import op

# revision identifiers, used by Alembic.
revision = "83d01e7ad41c"
down_revision = "9d3d34fcf6b4"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "rag_search_setting_configuration_versions",
        sa.Column("deleted_at", sa.TIMESTAMP(), nullable=True),
    )
    op.alter_column(
        "rag_search_setting_configuration_versions",
        "settings",
        existing_type=postgresql.JSON(astext_type=sa.Text()),
        nullable=True,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "rag_search_setting_configuration_versions",
        "settings",
        existing_type=postgresql.JSON(astext_type=sa.Text()),
        nullable=False,
    )
    op.drop_column("rag_search_setting_configuration_versions", "deleted_at")
    # ### end Alembic commands ###
