Files
LeDiscord/backend/scripts/migrate.sh
EvanChal d63f2f9f51
Some checks failed
Deploy to Development / build-and-deploy (push) Failing after 36s
Deploy to Production / build-and-deploy (push) Successful in 1m48s
fix(pwa): added PWAInstallTutorial to handle pwa install instructions
2026-01-26 22:08:57 +01:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Script helper pour gérer les migrations Alembic
set -e
case "$1" in
create)
if [ -z "$2" ]; then
echo "Usage: ./scripts/migrate.sh create 'message de migration'"
exit 1
fi
alembic revision --autogenerate -m "$2"
;;
upgrade)
alembic upgrade head
;;
downgrade)
if [ -z "$2" ]; then
alembic downgrade -1
else
alembic downgrade "$2"
fi
;;
current)
alembic current
;;
history)
alembic history
;;
*)
echo "Usage: ./scripts/migrate.sh {create|upgrade|downgrade|current|history}"
echo ""
echo "Commands:"
echo " create 'message' - Créer une nouvelle migration"
echo " upgrade - Appliquer toutes les migrations en attente"
echo " downgrade [rev] - Revenir en arrière (par défaut -1)"
echo " current - Afficher la migration actuelle"
echo " history - Afficher l'historique des migrations"
exit 1
;;
esac