Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel migration cancelled

when I trying to migrate something I get this error:

**************************************
*     Application In Production!     *
**************************************

Do you really wish to run this command?
Command Cancelled!

Im running a centOS 6.5 server without Plesk 12 Is there anyway to figure out what the error is or how to solve it?

Thanks

like image 540
Robin Timman Avatar asked Dec 26 '14 10:12

Robin Timman


People also ask

How can I migrate to Laravel again?

IF you want to re-migrate all the database, you can simply do: php artisan migrate:refresh . IF you want to make sure your database to be clean with your latest changes, you can drop your entire database tables and do php artisan migrate again. Also, you can try php artisan migrate --seed if you have any seeder.

Is migration necessary in Laravel?

Migrations are an integral part of the Laravel procedure and are usually done in conjecture with the Laravel schema builder. This helps to build easily the database schema. Laravel Migrations are an essential part of the Laravel architecture.

Can I delete migration file Laravel?

If you've only created the migration and you've not executed the php artisan migrate command, all you would need to do to remove the migration is to delete the file. You could do that via your text editor or the command line with the rm command.


2 Answers

A bit late for answer but just for info purpose you can use php artisan migrate --force to avoid it OR in laravel 5.2 they are using a key env in config/app.php configure it to avoid this prompt reference https://github.com/laravel/laravel/blob/master/config/app.php

like image 147
MM2 Avatar answered Oct 06 '22 04:10

MM2


Just use --force flag in production:

php artisan migrate --force

https://laravel.com/docs/6.x/migrations#running-migrations

Forcing Migrations To Run In Production

Some migration operations are destructive, which means they may cause you to lose data. In order to protect you from running these commands against your production database, you will be prompted for confirmation before the commands are executed. To force the commands to run without a prompt, use the --force flag.

like image 31
Вячеслав Ташкинов Avatar answered Oct 06 '22 03:10

Вячеслав Ташкинов