MetaSkills.net

Rake task to read and write the ActiveRecord schema version table.

Posted On: January 31st, 2007 by kencollins

After attending Rails Edge in Reston, Virginia I decided to move some common tasks from my ~/.irbrc file and put them into Rake. I thought I would share a task that reads and writes the ActiveRecord schema table. Sometimes in migrations this is either good to know or manually change. Simply copy this in a foo.task file in your project/lib/tasks directory and use rake -T to see the description and usage. I have placed these tasks in the db:version namespace.

Tags: activerecord

Custom Rake Task To Unload Fixtures

Posted On: October 2nd, 2006 by kencollins

I made a revised version of a rake task that I have used quite often, for unloading existing DB tables into fixture data and thought I would share. This rake task is the in correct name space and adds a "rake db:fixtures:unload" command to your rails project when you put this in "lib/tasks/foo.rake". It can take an optional TABLES variable or if none is present the whole array of DB tables are converted. I find this rake task helpful when dealing with LARGE databases.

Tags: activerecord