#!/usr/bin/env bash
set -euo pipefail

echo "📦 Copie du script SQL de migration…"
docker compose cp backend/sql/migrate_matches_add_cols.sql db:/tmp/migrate_matches_add_cols.sql

echo "🗃  Application de la migration sur la base 'supersunday'…"
docker compose exec db sh -lc 'psql -U postgres -d supersunday -f /tmp/migrate_matches_add_cols.sql'

echo "✅ Migration terminée."
