summaryrefslogtreecommitdiff
path: root/db/migrate/20140427001407_add_notified_object.mailboxer_engine.rb
blob: 7f41ac6421914a508ced98c1cdd037d375ea30b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This migration comes from mailboxer_engine (originally 20110719110700)
class AddNotifiedObject < ActiveRecord::Migration
  def self.up
    change_table :notifications do |t|
      t.references :notified_object, :polymorphic => true
      t.remove :object_id
      t.remove :object_type
    end
  end

  def self.down
    change_table :notifications do |t|
      t.remove :notified_object_id
      t.remove :notified_object_type
      t.references :object, :polymorphic => true
    end
  end
end