mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 09:51:03 +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
|
66
db/schema.rb
66
db/schema.rb
|
@ -16,6 +16,17 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "address_versions", force: true 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 "address_versions", ["item_type", "item_id"], name: "index_address_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
create_table "addresses", force: true do |t|
|
||||
t.integer "contact_id"
|
||||
t.integer "country_id"
|
||||
|
@ -43,6 +54,17 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "contact_versions", force: true 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"], name: "index_contact_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
create_table "contacts", force: true do |t|
|
||||
t.string "code"
|
||||
t.string "type"
|
||||
|
@ -84,6 +106,17 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "domain_status_versions", force: true 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 "domain_status_versions", ["item_type", "item_id"], name: "index_domain_status_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
create_table "domain_statuses", force: true do |t|
|
||||
t.integer "domain_id"
|
||||
t.string "description"
|
||||
|
@ -102,6 +135,17 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
t.datetime "wait_until"
|
||||
end
|
||||
|
||||
create_table "domain_versions", force: true 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 "domain_versions", ["item_type", "item_id"], name: "index_domain_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
create_table "domains", force: true do |t|
|
||||
t.string "name"
|
||||
t.integer "registrar_id"
|
||||
|
@ -140,6 +184,17 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "nameserver_versions", force: true 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 "nameserver_versions", ["item_type", "item_id"], name: "index_nameserver_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
create_table "nameservers", force: true do |t|
|
||||
t.string "hostname"
|
||||
t.string "ipv4"
|
||||
|
@ -211,4 +266,15 @@ ActiveRecord::Schema.define(version: 20141001085322) do
|
|||
t.integer "country_id"
|
||||
end
|
||||
|
||||
create_table "versions", force: true 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"], name: "index_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue