From 1a2dc2fb74dfa2bc5e26f2476992321299497d1f Mon Sep 17 00:00:00 2001 From: Denis Torresan Date: Mon, 29 Apr 2024 10:52:52 +0200 Subject: [PATCH] run migrations and seed via env RUN_MIGRATIONS --- deployment/start-container | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deployment/start-container b/deployment/start-container index 0bab02b..598d880 100644 --- a/deployment/start-container +++ b/deployment/start-container @@ -3,6 +3,7 @@ set -e container_mode=${CONTAINER_MODE:-http} octane_server=${OCTANE_SERVER} +run_migrations=${RUN_MIGRATIONS:-false} echo "Container mode: $container_mode" initialStuff() { @@ -10,6 +11,11 @@ initialStuff() { php artisan event:cache; \ php artisan config:cache; \ php artisan route:cache; + + if [ ${run_migrations} = "true" ]; then + echo "Run migrations and seeding database ..." + php artisan migrate --seed --force; + fi } if [ "$1" != "" ]; then