I understand that according to Rails philosophy, data integrity checks should be done at the application level as opposed to the database level. Like many other developers, I en
It is for this reason that I (and the people who wrote Enterprise Rails - http://oreilly.com/catalog/9780596515201) recommend that you write your entire up and down migrations in SQL.
The advantages are:
There are disadvantages:
But, overall I reckon the advantages outweigh the disadvantages.
Quick example:
def self.up
execute <