The Art of Doctrine Migrations
by Ryan Weaver
- 15,891 views
Doctrine Migrations presentation from the nasvhille symfony user group - February 2010
Doctrine Migrations presentation from the nasvhille symfony user group - February 2010
Accessibility
Categories
Upload Details
Uploaded via SlideShare as Adobe PDF
Usage Rights
© All Rights Reserved
Statistics
- Likes
- 13
- Downloads
- 156
- Comments
- 9
- Embed Views
- Views on SlideShare
- 14,385
- Total Views
- 15,891
I don't exactly what problem you're getting at, but I do know that there are definitely issues with Doctrine1 (and Doctrine1's migrations) related to the naming of things, how versions are tracked etc. In fact, the importance of this presentation is really to highlight how you can use a system that's far from perfect to solve a problem.
The better answer is this: Symfony2 and Doctrine2 are different. The Doctrine migrations now exist as a standalone library from the Doctrine community and - while not yet stable - is very well done (the design takes a lot from other languages and how they solve the problem of migrations). Symfony2 is much the same way - nothing is imposed on you and where there *are* standards, they exist only for convenience and you're free to use whatever standard you want.
So, if you're frustrated by some issues or conventions with Doctrine1 or symfony1, I'd encourage you to have a look at Doctrine2 and Symfony2 - a lot of work has been done to learn from the first versions.
And if I totally missed your question/comment, let me know :) 2 years ago
To rely on something as fickle and abstract as a naming convention rather than scope to avoid conflict essentially renders the application useless as a serious, enterprise building tool.
I am not encouraged by the insistence in both Doctrine and Symfony on this approach. It might work for small, simple databases and systems but basing internal structures based on a name rather than a definition is a really bad design choice.
You throw out all the flexibility of underlying systems and make it almost impossible to build large multi application environment effectively and efficiently.
Each of the components in the layer - RDBMS, PHP, and even the file system, understand scope, none of them care about naming. 2 years ago
- ssh prodserver symfony project:disable prod
- symfony project:deploy prod --go
- ssh prodserver symfony doctrine:migrate --env=prod
- ssh prodserver symfony project:clear-controllers
- ssh prodserver symfony project:permissions
- ssh prodserver symfony project:enable prod
the only problem is that when i do the doctrine:migrate i get the temporary unavailable page. i launch my commands like this:
- ssh produser@localhost ’~/website.com/symfony project:enable prod’ thanks a lot 3 years ago
thanks a lot again 3 years ago
thanks again 3 years ago
- Locally: symfony doctrine:generate-migrations-diff
- Locally: test using mysqldiff to make sure your database schema is up to date
- Production: symfony project:disable prod
- Locally: deploy all of your changes (including your new migration files) to productio
- Production: symfony doctrine:migrate
- Production: project:enable prod
I hope this helps. Your site only needs to be down during the migration itself. 3 years ago
as in
symfony project:disable prod
symfony doctrine:generate-migrations-diff
symfony doctrine:migrate
symfony project:enable prod
doing this gets the site unavailable page when doing the diff and the migration task 3 years ago