Answer the question
In order to leave comments, you need to log in
How to null or merge migrations and leave one?
Greetings!
There is a project on symfony4 + mysql
It has a standard folder with migrations Migrations There are a
lot of migrations themselves, several dozens.
How to make it so that there is only one migration left, from zero to the last current state?
In this case, no data would be lost.
Answer the question
In order to leave comments, you need to log in
If the migrations were done through
php bin/console make:migration
A, by saving data you mean the structure of the tables, and not their contents, then everything is simple:
1. delete all migrations
2. delete all tables from the database (including migrations)
3. run the "php bin/console make" command again :migration"
PS Just in case, make a backup of the database and a git-commit, so that in which case you can roll everything back.
PPS You can also save the data in the database - make the backup of the database a zero point, change it so that only commands for adding data remain in it, and dump the fourth point.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question