From edc6da3005b6f9eba2bede4073f81c903f7a529d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 25 Sep 2021 12:33:37 +0200 Subject: [PATCH] applique upgrade alembic dans le script de restoration --- tools/restore_scodoc9_data.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/restore_scodoc9_data.sh b/tools/restore_scodoc9_data.sh index 5bcc3566a..12e09b191 100644 --- a/tools/restore_scodoc9_data.sh +++ b/tools/restore_scodoc9_data.sh @@ -76,11 +76,15 @@ then echo "Suppression de la base $DBNAME..." su -c "dropdb $DBNAME" "$SCODOC_USER" || die "Erreur destruction db" fi -su -c "createdb $DBNAME" "$SCODOC_USER" || die "Erreur destruction db" +su -c "createdb $DBNAME" "$SCODOC_USER" || die "Erreur création db" echo "Chargement de la base SQL..." su -c "pg_restore -d $DBNAME ${SCODOC_VAR_DIR}/SCODOC.dump" "$SCODOC_USER" || die "Erreur chargement de la base SQL" +# -- Apply migrations if needed (only on "production" databse, = SCODOC sauf config particulière) +export FLASK_ENV="production" +su -c "(cd $SCODOC_DIR && source venv/bin/activate && flask db upgrade)" "$SCODOC_USER" + # -- Start ScoDoc systemctl start scodoc9