From d4eabf19374d91c29027ae6aa094192eb8068e09 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 21:47:59 +0100 Subject: [PATCH] feat(db): add APP_ENV in doctrine-migrate script --- bin/doctrine-migrate | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/doctrine-migrate b/bin/doctrine-migrate index 42a19a0..1125cd8 100755 --- a/bin/doctrine-migrate +++ b/bin/doctrine-migrate @@ -1,7 +1,9 @@ #!/bin/sh -CLASS_NAME="$(echo "yes" | "$PHP" ./bin/console doctrine:migration:diff -e dev | grep -o "Version[0-9]*" | tail -n 1)" +APP_ENV="${APP_ENV:-dev}" + +CLASS_NAME="$(echo "yes" | "$PHP" ./bin/console doctrine:migration:diff -e "$APP_ENV" | grep -o "Version[0-9]*" | tail -n 1)" if [ -n "$CLASS_NAME" ]; then - echo "yes" | "$PHP" ./bin/console doctrine:migration:exec --up "DoctrineMigrations\\$CLASS_NAME" -e dev + echo "yes" | "$PHP" ./bin/console doctrine:migration:exec --up "DoctrineMigrations\\$CLASS_NAME" -e "$APP_ENV" fi