fix+feat(everything): lot of things
Some checks failed
Deploy to Development / build-and-deploy (push) Failing after 20s
Some checks failed
Deploy to Development / build-and-deploy (push) Failing after 20s
This commit is contained in:
42
backend/scripts/migrate.sh
Executable file
42
backend/scripts/migrate.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user