"""Phase 11.5 — Localization, RTL/LTR & Media schema."""
from alembic import op
from app.core.database import Base
import app.models  # noqa: F401

revision = "0006_phase_115_loc_media"
down_revision = "0005_phase_114_templates"
branch_labels = None
depends_on = None


def upgrade():
    bind = op.get_bind()
    Base.metadata.create_all(bind=bind)


def downgrade():
    bind = op.get_bind()
    for table in (
        "experience_media_refs",
        "experience_localizations",
        "experience_site_locale_bindings",
    ):
        if table in Base.metadata.tables:
            Base.metadata.tables[table].drop(bind=bind, checkfirst=True)
