Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

enkla's avatar
Level 8

php artisan migrate --force erros

I am having problem with php artisan migrate --force command in production environment. It create table or column already existed error. I can't run other commands, I lose data already existed on database. How can i solve the problem ? Thanks

0 likes
2 replies
siangboon's avatar

stop doing anything on production when you are not sure or not tested... Highly recommended restore the latest available backup copy and duplicate the copy to testing environment...

haztakki's avatar

I assume you are editing existing migrations which is where you are going to run into problems. For local dev, I just usually just run php artisan migrate:fresh but in production you should NOT do this. You'll lose all of your data. Instead do something like:

php artisan make:migration add_website_column_to_users_table

Then add your new column inside that migration file. Once that is done, you can then run: php artisan migrate

1 like

Please or to participate in this conversation.