Sunday, August 30, 2009

Simple Rake task for dumps

Rails ships with a lot of rake tasks, you can check the defaults by typing rake -T from your project's root, many of them make operations over the database, like; create, drop, reset, clone among others, but we wanted a simple rake task to generate dumps and import them into the current environment's db, Rails include a dump task that generates your current db schema, in our case we dump everything, data and schema in a sql file. You can find a LOT of rake tasks for dumps out there, but I like this simplicity!