I have been searching at the variety of getting our database schemas under version control. It appears that Ruby everyone has got Rails Migrations, and .Internet folks enjoy a couple of options (for example this, this, and this). How about Perl?
I have seen this thread on PerlMonks which does not cash, even though it mentions DBIX::Migration::Sites. Is anybody really by using this module, as well as other module? Or would you roll your personal DB migration solutions?
- We don't use DBIx::Class typically
- We use MySQL
- We use SVN
One quite interesting project that's still most likely just a little youthful to depend on is Adam Kennedy's ORLite::Migrate that takes it's inspiration from Rails migrations. He authored up a really interesting journal at use.perl.org about his plans and that i aspire to keep close track of it for future years.
It will appear this package is only for SQLite right now however i think Adam's thinking about building this to become more database agnostic later on.
At the office, we make use of a modified version of DBIx::Migration (it's some restrictions, for example a maximum of 10 migrations). Then, you've got a core schema that you have left out of your database so when the version number is not high enough, you change your database while using migrations in the migration schema directory.
I additionally recommend the Database Refactoring book. Among other activities, you'll have excellent approaches for controlling migrations securely in a way that if you want to roll back, you do not lose data (for example whenever you drop a column you believe you do not need).
To assist using the automatic deprecation agendas it indicates, I have written Devel::Deprecate to ensure that you don't have to remember when you should perform the deprecations. Your code will complain noisally for you personally (and just in testing, not in production).
Important: You'll periodically discover that you are using a lot of database migration levels with this particular technique that you will sometimes have to "boostInch your minimum base migration since it takes too lengthy to rebuild the database. Simply take a brand new dump from the database in the preferred migration level and take away all migrations under or comparable to that much cla.
In POPFile we use our very own solution. We store a schema version number within the db and when this program picks up that there's a more recent schema, it'll update the db accordingly. This isn't precisely the best and many fun a part of our code.
To tell the truth, I neglect to see the benefit of using DBIx::Migration::Sites should you aren't already using DBIx::Class. You need to supply the SQL and also the version amounts and also the database handle. You may as well provide a bit more code to obtain the sql file and and feed it towards the database.
Obviously, getting the schema in version control is a superb bonus.