Last Updated: February 25, 2016
·
2.444K
· emgiezet

Auto generated doctrine migrations don't execute in transaction

When you're applying an auto-generated doctrine migrations to your environment ex. staging or production. Remember to test it well. Because they executing sql by sql. And when last migration throws PDOException you're in serious trouble. How serious? It depends on environment :).

Before you reapply the migration you need to clean up your database bit by bit ex. removing added columns dropping indexes etc.

Conclusion.
1. Test your migration on your local development station!
2. Always Backup that DB you're migrating!
3. Again first test and later trust the generated migration!