Thursday, April 14, 2022

[FIXED] how to reduce migrations of existing website that is developed in laravel

Issue

I have 1000+ migrations of a website and tables are only 300-400, now i want to reduce the number of migrations without loosing any data is there any possibility to do it.


Solution

In Laravel 8 you'll be able to dump the database and throw away migrations thanks to this PR

In the mean time, you can take a look at the PR code and implement it in your current version https://github.com/laravel/framework/pull/32275/files.

The main idea is to use mysqldump (or pgdump, depending on your database) to dump your current database state and run a migration to import it.



Answered By - Elie Faës
Answer Checked By - Robin (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.