jeudi 21 mars 2019

Laravel 5 Production Migrations -- Unable to Disable Migration Warning

I'm trying to deploy a Laravel website in production mode. The site is currently deployed, but I've added a database and some migrations plus seeds, and the deployment for the migrations is failing.

The logs are showing me that the Migrations fail because the production mode brings up a prompt that says

Migrating the database tables into your application
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > 

  Aborted  

I've tried working around this by piping "yes" into the migration command in my deploy script, but it did't work. Presumably I could change the mode to NOT production, but I don't think that's an appropriate fix here. I also tried using the "--force" flag for migrations but it didn't prevent the warning.

deploy script

cd /home/forge/default
git pull origin master
npm install --save-dev cross-env
npm install
composer require nesbot/carbon:1.26.3
composer require tcg/voyager
composer install --no-interaction --prefer-dist --optimize-autoloader
npm run development
echo "" | sudo -S service php7.2-fpm reload

if [ -f artisan ]
then
    php artisan config:cache
    php artisan voyager:install
    php artisan migrate --force
    php artisan db:seed --class=CategoriesTableSeeder --force
    php artisan db:seed --class=UsersTable --force
    php artisan db:seed --class=BlogPostsTableSeeder --force
fi

Does anyone know how I can disable this warning in production or why the force option isn't suppressing this warning so I can run the migrations?

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire