D
D
d999992021-05-12 16:13:15
symfony
d99999, 2021-05-12 16:13:15

In Symfony, is it better to create one large migration or many small ones (separate for each table)?

How is it better to create a migration using Symfony? And why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2021-05-12
@firedragon

Migration means one change, one feature. It must be reversible and contain all data.
Therefore, the feature should be small, and the migration should include all tables that have changed

I
index0h, 2021-05-12
@index0h

Symfony has nothing to do with it.
If within a specific task you need several tables, create them in one migration. Dividing into files for the sake of sharing is a very so-so idea.
If you need several different migration steps as part of the deployment, you should separate them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question