Search code examples
laraveldeploymentlaravel-5laravel-envoy

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:

[user@xxxx]: **************************************
*     Application In Production!     *
**************************************
[user@xxxx]: Command Cancelled!
[user@xxxx]: Application is now live.

Solution

  • 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