Home
Ruby on Rails
Cheatsheets
Takes a single string identifying a valid SQL command to execute directly.
execute "alter table line_items add constraint fk_line_item_products foreign key (product_id) references products(id)"
Use in the down method of a migration file to raise an exception when the up methods of the same migration file can not be reversed, e.g. changing a column type from :integer to :string.
raise ActiveRecord::IrreversibleMigration
A look at the new features and syntax available in migrations on Rails 2.0
More
A brilliant plugin that makes changing your database schema even easier and faster.
More