Why were they invented, if it is possible to throw out a dump along with the source code?
I feel that the question is the dumbest ^^ do not throw slippers.
Most often, migration is used to correctly move the base to a new structure. In projects, it often happens that before everyone followed the same structure, and then the existing database needs to be redone, but the data cannot be lost. To do this, use migration.