uniqueginun's avatar

Running migration on production

Hello

I am working on an application which is connected to existing mysql database. the application itself doesn't have migration files. now I added new feature and I used migrations. I want to know what will happen if I run php artisan migrate on production. will that ignore existing tables and create new once from migration files and add them to migrations table!!

0 likes
4 replies
LaryAI's avatar
Level 58

Running php artisan migrate on production will execute any pending migrations that have not been run yet. It will not ignore existing tables, but it will only create new tables that are defined in the migration files and add them to the migrations table.

If you have already manually created tables in the production database that are not defined in migration files, running php artisan migrate will not affect those tables. It will only create new tables defined in the migration files.

To avoid any potential issues, it is recommended to backup your production database before running migrations.

tisuchi's avatar

@uniqueginun

will that ignore existing tables and create new once from migration files and add them to migrations table!!

YES

3 likes

Please or to participate in this conversation.