summaryrefslogtreecommitdiff
path: root/db/migrate/20120229204755_create_admin_notes.rb
blob: a2d3247ee7e8151a55e367922cb93a439a611e9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CreateAdminNotes < ActiveRecord::Migration
  def self.up
    create_table :admin_notes do |t|
      t.references :resource, :polymorphic => true, :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