"""Add sections column to content_pages

Revision ID: z8i9j0k1l2m3
Revises: z7h8i9j0k1l2
Create Date: 2026-01-23

Adds sections JSON column for structured homepage editing with multi-language support.
The sections column stores hero, features, pricing, and cta configurations
with TranslatableText pattern for i18n.
"""

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "z8i9j0k1l2m3"
down_revision = "z7h8i9j0k1l2"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "content_pages",
        sa.Column(
            "sections",
            sa.JSON(),
            nullable=True,
            comment="Structured homepage sections (hero, features, pricing, cta) with i18n",
        ),
    )


def downgrade() -> None:
    op.drop_column("content_pages", "sections")
