"""plots.public_description (INDL-42 Add/Edit Plot & CSV Import)

Adds the public-facing listing blurb surfaced on the availability page (AC-08).
This is the only column INDL-42 owns; every other field it consumes
(geometry / centroid / reserved_by / reserved_at / label_manual / status) is
owned by INDL-41 migrations (0047-0051 on develop after linearisation).

Chains off 0052 (the develop head at merge time). Idempotent
(ADD COLUMN IF NOT EXISTS) so it is safe to re-run.
"""
from alembic import op
import sqlalchemy as sa

revision = "0053"
down_revision = "0052"
branch_labels = None
depends_on = None


def upgrade() -> None:
    conn = op.get_bind()
    conn.execute(sa.text(
        "ALTER TABLE plots ADD COLUMN IF NOT EXISTS public_description VARCHAR(180) NULL"
    ))


def downgrade() -> None:
    conn = op.get_bind()
    conn.execute(sa.text("ALTER TABLE plots DROP COLUMN IF EXISTS public_description"))
