"""Add ``validations`` JSONB column to ``codal_media`` table.

Revision ID: 0024
"""
from __future__ import annotations

from repo_core.migrations.builder import MigrationBuilder
from repo_core.migrations.runner import Migration

VERSION = "0024"


def get_postgres_migrations() -> list[Migration]:
    return [
        Migration(
            version="codal_media_validations_0001",
            description="Add validations JSONB column to codal_media",
            up=(
                MigrationBuilder("codal_media")
                .add_column("validations", "JSONB", nullable=True)
                .alter_table()
            ),
            down=(
                MigrationBuilder("codal_media")
                .drop_column("validations")
                .alter_table()
            ),
        ),
    ]
