"""add title_translations and content_translations to content_pages

Revision ID: cms_002
Revises: z_unique_subdomain_domain
Create Date: 2026-03-02
"""

import sqlalchemy as sa

from alembic import op

revision = "cms_002"
down_revision = "z_unique_subdomain_domain"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "content_pages",
        sa.Column(
            "title_translations",
            sa.JSON(),
            nullable=True,
            comment="Language-keyed title dict for multi-language support",
        ),
    )
    op.add_column(
        "content_pages",
        sa.Column(
            "content_translations",
            sa.JSON(),
            nullable=True,
            comment="Language-keyed content dict for multi-language support",
        ),
    )


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