I have a Symfony 3 application where I use deployer to deploy my application. Also I am using Doctrine Migrations to migrate my database.
I use the symfony3 recipe.
When I run dep deploy
, deployer migrates my database. However, when I run dep rollback
it doesn't rollback the respective doctrine migrations.
I have searched through Google and Stackoverflow to find anybody solving this, but I can't seem to find anybody.
Do you have a good idea?
You can use backwards compatible migrations, this way no rollback is needed ever.
As it can result in a messy database, it's often a good idea to clean up the BC layers regularly. For instance:
full name
column, but instead split up in first name
and last name
. The full name
column is still kept to be backwards compatible;full name
column, no migration rollbacks are needed;full name
values are split in first name
and last name
and then remove the full name
column completely;full name
, no migration rollbacks are needed.