WIA/db/migrate/20120505001949_create_admin_notes.rb

18 lines
472 B
Ruby
Raw Normal View History

2012-05-05 00:21:41 -04:00
class CreateAdminNotes < ActiveRecord::Migration
def self.up
create_table :admin_notes do |t|
t.string :resource_id, :null => false
t.string :resource_type, :null => false
t.references :admin_user, :polymorphic => true
t.text :body
t.timestamps
end
add_index :admin_notes, [:resource_type, :resource_id]
add_index :admin_notes, [:admin_user_type, :admin_user_id]
end
def self.down
drop_table :admin_notes
end
end