zoki's avatar

zoki wrote a comment+100 XP

3mos ago

@koulritesh98 While developing, you added some new tables or columns to existing tables, after you deployed to production. You add them by writing new migrations. Then, when you update your production site, you also update your table by running "php artisan migrate". It will ask you "are you sure, this is prod?", you answer yes, and the prod DB is updated. It will run only the newly added migrations, not the old ones. How, might you ask? It keeps a list of migrations that have been already run in the DB table called "migrations". Open it and see for yourself.

Of course, it goes without saying: always double check what your migrations are doing and always made a DB backup before updating.