Logging contacts and addresses,view undeleted ones

This commit is contained in:
Andres Keskküla 2014-09-26 15:01:02 +03:00
parent bb3d2cc88a
commit d94eb22fc6
14 changed files with 263 additions and 3 deletions

View file

@ -0,0 +1,13 @@
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
add_index :versions, [:item_type, :item_id]
end
end

View file

@ -0,0 +1,25 @@
class ContactAndVersionArchiving < ActiveRecord::Migration
def change
create_table :contact_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
create_table :address_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
add_index :contact_versions, [:item_type, :item_id]
add_index :address_versions, [:item_type, :item_id]
end
end