sfDoctrineMysqlSafeMigratePlugin - 0.1.0

Allows rolling back from a failed migration on a MySQL database

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
sfDoctrineMysqlSafeMigratePlugin 0.1.0beta for sf 1.4 and Doctrine MIT
Plugin image
2
users
Sign-in
to change
your status

As MySQL InnoDB implict commits on a table alteration Doctrine migrations that error will leave a database inbetween states. This plugin uses mysqldump to back up the database prior to migration and restores it on failure. This also allows you to use a dry run

This plugin is to ease the usage of Doctrine migrations with MySQL database by adding the ability to roll back on an error.

Doctrine migrations are designed to roll back to the previous state when an error occurs but this cannot happen with MySQL (at least InnoDB) because of implicit commits on structure altering queries. To counter this problem this plugin uses mysqldump to get a snapshot of your database before the migration and then in the event of an error or a migration dry run the backup will be restored.

Because of the nature of a database backup and a restore, there is the possibility for dataloss during the process of running a migration, with a large database this could of course make the process very slow. The primary usage of this plugin is for in a dev/test environment to ensure migration classes are accurate.

Developers

Name Status Email
gravatar Kevin Dew lead ku.oc.snoituloswed <<ta>> vek

License

Show source

Copyright (c) 2010 Kevin Dew <kev@dewsolutions.co.uk>

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
THE SOFTWARE.