Add seeding for database

This commit is contained in:
philipp lang 2025-04-03 23:07:03 +02:00
parent 8e1f7869e2
commit 3f44fbe5b0
1 changed files with 1 additions and 1 deletions
.docker/php

View File

@ -28,7 +28,7 @@ fi
if [ $1 == "app" ]; then
# --------------------------- ensure appkey is set ----------------------------
wait_for_db
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || ( php artisan migrate --seed --force && php artisan db:seed )
su www-data -c 'php artisan migrate --force'
php artisan scout:sync-index-settings
php-fpm -F -R -O