"""drop dead Job flat runner columns

Revision ID: 11939e54d764
Revises: e638cec9a12a
Create Date: 2026-06-28 20:02:14.860002

"""

from collections.abc import Sequence

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

# revision identifiers, used by Alembic.
revision: str = "11939e54d764"
down_revision: str | Sequence[str] | None = "e638cec9a12a"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("jobs", "git_remote")
    op.drop_column("jobs", "dockerfile")
    op.drop_column("jobs", "git_sha")
    op.drop_column("jobs", "image_tag")
    op.drop_column("jobs", "git_branch")
    op.drop_column("jobs", "kubernetes_config")
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "jobs",
        sa.Column("kubernetes_config", postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True),
    )
    op.add_column("jobs", sa.Column("git_branch", sa.VARCHAR(), autoincrement=False, nullable=True))
    op.add_column("jobs", sa.Column("image_tag", sa.VARCHAR(), autoincrement=False, nullable=True))
    op.add_column("jobs", sa.Column("git_sha", sa.VARCHAR(length=40), autoincrement=False, nullable=True))
    op.add_column("jobs", sa.Column("dockerfile", sa.VARCHAR(), autoincrement=False, nullable=True))
    op.add_column("jobs", sa.Column("git_remote", sa.VARCHAR(), autoincrement=False, nullable=True))
    # ### end Alembic commands ###
