28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
Super Sunday — Migration SQL pour la table matches
|
|
=================================================
|
|
|
|
Problème rencontré:
|
|
- L'API attend les colonnes `player_a_id`, `player_b_id`, `finished`, `score_a`, `score_b`, etc.
|
|
- Votre table `matches` courante ne les contient pas, d'où les erreurs 42703 (undefined column).
|
|
|
|
Ce patch ajoute **sans casser l'existant** les colonnes manquantes et définit des valeurs par défaut.
|
|
|
|
Fichiers:
|
|
- backend/sql/migrate_matches_add_cols.sql
|
|
- apply_matches_migration.sh
|
|
|
|
Utilisation:
|
|
1) Dézippez à la racine du projet :
|
|
unzip -o supersunday_matches_migration_patch.zip -d .
|
|
|
|
2) Appliquez la migration :
|
|
./apply_matches_migration.sh
|
|
|
|
3) Vérifiez la structure :
|
|
docker compose exec db psql -U postgres -d supersunday -c '\d+ matches'
|
|
|
|
4) Re-testez les routes :
|
|
curl -s http://localhost/api/matches
|
|
curl -s -X POST http://localhost/api/matches -H 'Content-Type: application/json' -d '{"tournament_id":1,"court":"Court 1"}'
|
|
curl -s -X POST http://localhost/api/matches/1/score -H 'Content-Type: application/json' -d '{"score_a":6,"score_b":4,"finished":true}'
|