mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Logging contacts and addresses,view undeleted ones
This commit is contained in:
parent
bb3d2cc88a
commit
d94eb22fc6
14 changed files with 263 additions and 3 deletions
13
db/migrate/20140926081324_create_versions.rb
Normal file
13
db/migrate/20140926081324_create_versions.rb
Normal 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
|
25
db/migrate/20140926082627_contact_and_version_archiving.rb
Normal file
25
db/migrate/20140926082627_contact_and_version_archiving.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue