2015-07-25 18:32:27 +02:00
|
|
|
# Add the version table necessary to paper trail
|
|
|
|
class CreateVersions < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :versions do |t|
|
|
|
|
t.string :item_type, null: false
|
|
|
|
t.integer :item_id, null: false
|
|
|
|
t.string :event, null: false
|
|
|
|
t.string :whodunnit
|
|
|
|
t.text :object
|
|
|
|
t.datetime :created_at
|
|
|
|
end
|
2017-04-22 20:01:47 +02:00
|
|
|
add_index :versions, %i[item_type item_id]
|
2015-07-25 18:32:27 +02:00
|
|
|
end
|
|
|
|
end
|