Displaying 1 result from an estimated 1 matches for "addnotescategoriesmapping".
2006 Apr 07
4
How to generate mapping with migration
Hi there, I''ve tried to add a m:n mapping table using the migration
mechanism.
ruby script\generate migration add_categories_notes_mapping
and filled the migration file with:
class AddNotesCategoriesMapping < ActiveRecord::Migration
def self.up
create_table :categories_notes do |t|
t.column :category_id, :integer, :null=>false
t.column :note_id, :integer, :null=>false
end
end
def self.down
drop_table :categories_notes
end
end
Now, I''d like to define both fie...