Automate your database content migrations
Rails manages database schema migrations with the minimum of fuss, but the prospect of copying database content between a number of development and deployment machines has long filled me with a faint sense of dread.
Usually, I have resorted to the cumbersome process of producing and tarball-ing an SQL dump of the data, transferring it to the new machine, booting up mysql, importing the data… it’s lengthy, tiresome and error-prone.
Despite toying with the idea of writing a rake task to automate the process many times, I’ve never quite got it together. So I’m happy to come across this plugin. It’s not quite brand new - but it works well, and better still it’s database independent, which means you can switch your entire DB from say, MySQL to Postgres and back with ease.
http://blog.heroku.com/archives/2007/11/23/yamldb_for_databaseindependent_data_dumps/
Tags: rake, Ruby on Rails, sql