#!/usr/bin/env bash
# Flyway validate against local Postgres from repo-root docker-compose.
# Requires existing flyway_schema_history (run migrate at least once). Does not run migrate.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
if [[ ! -f .env ]]; then
  echo "ERROR: missing .env (copy from .env.example)"
  exit 1
fi
docker compose --env-file .env run --rm flyway validate
