Ad

Cant Run A Migration When Deploying. Laravel 5.2

Consider the following task for envoy:

@task('deploy', ['on' => 'web'])
    cd personal_site
    php artisan down
    git pull origin master
    composer install
    php artisan migrate
    php artisan up
@endtask

php artisan migrate // Blows up

The error is:

[[email protected]]: **************************************
*     Application In Production!     *
**************************************
[[email protected]]: Command Cancelled!
[[email protected]]: Application is now live.
Ad

Answer

This warning is a security measure to prevent accidental migrations being run on production environment. If you're sure you want to run them in that environment, you need to use --force option:

php artisan migrate --force
Ad
source: stackoverflow.com
Ad