20120711000838_create_admin_notes.rb 472 B

1234567891011121314151617
  1. class CreateAdminNotes < ActiveRecord::Migration
  2. def self.up
  3. create_table :admin_notes do |t|
  4. t.string :resource_id, :null => false
  5. t.string :resource_type, :null => false
  6. t.references :admin_user, :polymorphic => true
  7. t.text :body
  8. t.timestamps
  9. end
  10. add_index :admin_notes, [:resource_type, :resource_id]
  11. add_index :admin_notes, [:admin_user_type, :admin_user_id]
  12. end
  13. def self.down
  14. drop_table :admin_notes
  15. end
  16. end