Thursday, June 18, 2009

Migration Helpers To Add Foreign Keys etc...

Rails plugin for adding foreign key constraints in a simple way:
http://github.com/patientslikeme/migration_helpers/tree/master

add_foreign_key 'address', 'user_id','users'

They also have a few simplified utility methods:

update_row 'books', :set => { :price => 4.99 }, :update_all => true
delete_row 'books', :author => 'Tolkien'

Enjoy.

No comments: