Question

According to the Doctrine docs, the cli schema tool should not be used to update the production database. This was a surprise to me, since one of the major selling points of doctrine was the ability to version control the database. Doctrine docs:

SchemaTool can do harm to your database. It will drop or alter tables, indexes, sequences and such. Please use this tool with caution in development and not on a production server. It is meant for helping you develop your Database Schema, but NOT with migrating schema from A to B in production. A safe approach would be generating the SQL on development server and saving it into SQL Migration files that are executed manually on the production server. SchemaTool assumes your Doctrine Project uses the given database on its own. Update and Drop commands will mess with other tables if they are not related to the current project that is using Doctrine. Please be careful!

I'm not familiar with generating a migration schema in MySQL. How can I automate the deployment of a new version of a production MySQL database that I've been managing in dev with Doctrine's cli tools?

Was it helpful?

Solution

It appears that the Doctrine Project (which is not just an ORM but also a collection of related projects) has a separate project for this, called Migrations. It seems to be aimed at safer deployments with options such as generating a SQL dump file, creating versions, rollback, etc.

Here's the currently working link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top