idlDoctrineMigrationPlugin - 1.0.0
Doctrine migration made easy
You are currently browsing
the website for symfony 1
Two extra task to consolidate migration process model:diff and model:update
idlDoctrineMigrationPlugin provide two useful task to help managing your model migration.
This is specially useful when multiple developers works on the same project.
|David Jeanmonod||lead||hc.leadi TA divad|
Copyright (c) 2010 Idael Software
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
idlDoctrineMigrationPlugin provide two useful task to manage your model migration.
Doing the migration with the base doctrine tools is possible but could cause some problem, especialy when multiples developers works on the same project. Typical issue can be:
Using the two tasks off this plugin will help you to avoid theses kind of problems.
$ symfony plugin:install idlDoctrineMigrationPlugin
The key concept around this plugin is to always perform model diff on schema.yml. As this is for most of us the main reference about the model.
So each time you generate a migration script with
model:diff , the current schema.yml is saved in /data/migration/history, and then can be reuse for next script generation.
When you change any schema.yml in your projet, or when you install a new plugin, then run model:diff task, that will generate migration script if require.
Then, to be sure that your database is always up to date according to your model. Stop using the base task doctrine:build. Call instead the new task
model:update. This task will execute the following action:
By following this simple workfollow, this two task simplfy the migration management
If you want to contribute please fell free to send your comment, and to share your pratices arround doctrine migration