Answer the question
In order to leave comments, you need to log in
Is it possible to create a migration per entity?
Good afternoon.
Example, created 3 entities User, Post, Comment.
If you execute make:migration, then one migration file is created, which reflects all actions with the specified entities.
Is it possible that when a command / function / etc. is called, separate migrations are created for each entity?
https://www.doctrine-project.org/projects/doctrine... did not find any information on this issue
PS https://www.doctrine-project.org/projects/doctrine...
The moral of the story is this: after each change you make to your Doctrine mapping information, run the doctrine:migrations:diff command to automatically generate your migration classes.
Answer the question
In order to leave comments, you need to log in
Migration is not grouped by entity change. The only option is to separate the migrations into folders (modules), so that the migrations of one entity fall into the folder and its table instead of the general one.
However, this is required more for modules. I don’t see the point in making migrations for each entity. The task of migrations is to monitor the data schema and change it. There is no point in trying to somehow separate one from the other. It won't do any good.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question