Feature Request
| Q |
A |
| New Feature |
yes |
| RFC |
no |
| BC Break |
no |
Summary
Use case
Execute different migrations in different stages. For example, you could have some migrations that are executed before the deployment and others that are executed after the deployment.
Implementation ideas
Allow executing a subset of migrations by passing a parameter to the migrations command. This could be achieved either by specifying a tag or a namespace. Here's how tags could work: you would add a getTags() method to the AbstractMigration, which would return an empty array or null by default. Concrete implementation could override the method and specify arbitrary tags (as an array of strings). When executing the migrations, you could call: ./bin/console doc:mig:mig --tag foo, which would only execute migrations tagged with foo. If you don't specify the --tag parameter, all migrations would be executed (BC is maintained).
Another option would be to specify the namespace of the migrations you wish to execute. This would execute only the migrations in the given namespace. Here's how that could work: ./bin/console doc:mig:mig --namespace MyApp\DoctrineMigrations\PreDeploy.
Feature Request
Summary
Use case
Execute different migrations in different stages. For example, you could have some migrations that are executed before the deployment and others that are executed after the deployment.
Implementation ideas
Allow executing a subset of migrations by passing a parameter to the migrations command. This could be achieved either by specifying a tag or a namespace. Here's how tags could work: you would add a
getTags()method to theAbstractMigration, which would return an empty array or null by default. Concrete implementation could override the method and specify arbitrary tags (as an array of strings). When executing the migrations, you could call:./bin/console doc:mig:mig --tag foo, which would only execute migrations tagged withfoo. If you don't specify the--tagparameter, all migrations would be executed (BC is maintained).Another option would be to specify the namespace of the migrations you wish to execute. This would execute only the migrations in the given namespace. Here's how that could work:
./bin/console doc:mig:mig --namespace MyApp\DoctrineMigrations\PreDeploy.