#!/usr/bin/env bash
# Script d'application de la migration 006 sur la DB locale Docker
# Usage : bash backend-api/migrations/apply_006_local.sh

set -euo pipefail

MYSQL_HOST="127.0.0.1"
MYSQL_PORT="3316"
MYSQL_USER="root"
MYSQL_PASS='CBAsJg97c=h*nWypYMV8!jbzG6e45XKDiw#dZHlUOqLmv0uf'
MYSQL_DBNAME="faildaily"

mysql -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" \
  "$MYSQL_DBNAME" < backend-api/migrations/006_legal_documents_birthdate_purposes.sql

echo "=== Migration 006 appliquée avec succès ==="
