mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Merge branch 'master' of github.com:domify/registry into country-refactor
Conflicts: app/models/address.rb app/models/country_deprecated.rb app/models/registrar.rb db/schema.rb
This commit is contained in:
commit
7537bb3712
91 changed files with 1614 additions and 698 deletions
28
db/migrate/20150128113257_add_json_based_versions.rb
Normal file
28
db/migrate/20150128113257_add_json_based_versions.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
class AddJsonBasedVersions < ActiveRecord::Migration
|
||||
def change
|
||||
%w(address contact_disclosure contact contact_status country dnskey
|
||||
domain_contact domain domain_status domain_transfer epp_user keyrelay
|
||||
legal_document message nameserver registrar
|
||||
reserved_domain setting user zonefile_setting
|
||||
).each do |name|
|
||||
table_name = "log_#{name.tableize}"
|
||||
|
||||
create_table table_name do |t|
|
||||
t.string :item_type, null: false
|
||||
t.integer :item_id, null: false
|
||||
t.string :event, null: false
|
||||
t.string :whodunnit
|
||||
t.json :object
|
||||
t.json :object_changes
|
||||
t.datetime :created_at
|
||||
end
|
||||
add_index table_name, [:item_type, :item_id]
|
||||
add_index table_name, :whodunnit
|
||||
|
||||
add_column name.tableize, :creator_id_tmp, :integer
|
||||
add_column name.tableize, :updater_id_tmp, :integer
|
||||
rename_column name.tableize, :creator_id_tmp, :creator_id
|
||||
rename_column name.tableize, :updater_id_tmp, :updater_id
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
class DropAllVersionsDisabledByDefault < ActiveRecord::Migration
|
||||
def change
|
||||
# All versions are depricated by log_* tables
|
||||
|
||||
# comment to remove unneeded old versions tables
|
||||
# drop_table "version_associations"
|
||||
# drop_table "versions"
|
||||
# drop_table "address_versions"
|
||||
# drop_table "contact_versions"
|
||||
# drop_table "domain_status_versions"
|
||||
# drop_table "domain_versions"
|
||||
# drop_table "nameserver_versions"
|
||||
end
|
||||
end
|
11
db/migrate/20150129093938_add_versions.rb
Normal file
11
db/migrate/20150129093938_add_versions.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class AddVersions < ActiveRecord::Migration
|
||||
def change
|
||||
if ActiveRecord::Base.connection.table_exists? 'versions'
|
||||
rename_table :versions, :depricated_versions
|
||||
end
|
||||
|
||||
create_table :versions do |t|
|
||||
t.text :depricated_table_but_somehow_paper_trail_tests_fails_without_it
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class RenameLogEppUserToLogApiUser < ActiveRecord::Migration
|
||||
def change
|
||||
rename_table :log_epp_users, :log_api_users
|
||||
end
|
||||
end
|
15
db/migrate/20150129144652_add_creator_and_updater.rb
Normal file
15
db/migrate/20150129144652_add_creator_and_updater.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class AddCreatorAndUpdater < ActiveRecord::Migration
|
||||
def change
|
||||
%w(address contact_disclosure contact contact_status country dnskey
|
||||
domain_contact domain domain_status domain_transfer api_user keyrelay
|
||||
legal_document message nameserver registrar
|
||||
reserved_domain setting user zonefile_setting
|
||||
).each do |name|
|
||||
table_name = name.tableize
|
||||
remove_column table_name, :creator_id, :string
|
||||
remove_column table_name, :updater_id, :string
|
||||
add_column table_name, :creator_str, :string
|
||||
add_column table_name, :updator_str, :string
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20150130155904_add_name_server_version_ids.rb
Normal file
5
db/migrate/20150130155904_add_name_server_version_ids.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddNameServerVersionIds < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :log_domains, :nameserver_version_ids, :text, array: true, default: []
|
||||
end
|
||||
end
|
7
db/migrate/20150130180452_add_meta_to_domain.rb
Normal file
7
db/migrate/20150130180452_add_meta_to_domain.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class AddMetaToDomain < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :log_domains, :nameserver_version_ids, :nameserver_ids
|
||||
add_column :log_domains, :tech_contact_ids, :text, array: true, default: []
|
||||
add_column :log_domains, :admin_contact_ids, :text, array: true, default: []
|
||||
end
|
||||
end
|
13
db/migrate/20150130191056_add_session_id_to_log.rb
Normal file
13
db/migrate/20150130191056_add_session_id_to_log.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
class AddSessionIdToLog < ActiveRecord::Migration
|
||||
def change
|
||||
%w(address contact_disclosure contact contact_status country dnskey
|
||||
domain_contact domain domain_status domain_transfer api_user keyrelay
|
||||
legal_document message nameserver registrar
|
||||
reserved_domain setting user zonefile_setting
|
||||
).each do |name|
|
||||
table_name = name.tableize
|
||||
add_column "log_#{table_name}", :session, :string
|
||||
add_column "log_#{table_name}", :children, :json
|
||||
end
|
||||
end
|
||||
end
|
574
db/schema.rb
574
db/schema.rb
|
@ -11,25 +11,19 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
<<<<<<< HEAD
|
||||
ActiveRecord::Schema.define(version: 20150202084444) do
|
||||
=======
|
||||
ActiveRecord::Schema.define(version: 20150130191056) do
|
||||
>>>>>>> c010000bfec582db543f6a89f263e92b7611c7ef
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "address_versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
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: :cascade do |t|
|
||||
t.integer "contact_id"
|
||||
t.integer "country_id"
|
||||
<<<<<<< HEAD
|
||||
t.string "city", limit: 255
|
||||
t.string "street", limit: 255
|
||||
t.string "zip", limit: 255
|
||||
|
@ -38,17 +32,30 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
t.string "street2", limit: 255
|
||||
t.string "street3", limit: 255
|
||||
t.string "country_code"
|
||||
=======
|
||||
t.string "city"
|
||||
t.string "street"
|
||||
t.string "zip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "street2"
|
||||
t.string "street3"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
>>>>>>> c010000bfec582db543f6a89f263e92b7611c7ef
|
||||
end
|
||||
|
||||
create_table "api_users", force: :cascade do |t|
|
||||
t.integer "registrar_id"
|
||||
t.string "username", limit: 255
|
||||
t.string "password", limit: 255
|
||||
t.boolean "active", default: false
|
||||
t.string "username"
|
||||
t.string "password"
|
||||
t.boolean "active", default: false
|
||||
t.text "csr"
|
||||
t.text "crt"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "cached_nameservers", id: false, force: :cascade do |t|
|
||||
|
@ -69,63 +76,60 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
t.boolean "name"
|
||||
t.boolean "org_name"
|
||||
t.boolean "address"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "contact_statuses", force: :cascade do |t|
|
||||
t.string "value", limit: 255
|
||||
t.string "description", limit: 255
|
||||
t.string "value"
|
||||
t.string "description"
|
||||
t.integer "contact_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "contact_versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
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: :cascade do |t|
|
||||
t.string "code", limit: 255
|
||||
t.string "type", limit: 255
|
||||
t.string "reg_no", limit: 255
|
||||
t.string "phone", limit: 255
|
||||
t.string "email", limit: 255
|
||||
t.string "fax", limit: 255
|
||||
t.string "code"
|
||||
t.string "type"
|
||||
t.string "reg_no"
|
||||
t.string "phone"
|
||||
t.string "email"
|
||||
t.string "fax"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "ident", limit: 255
|
||||
t.string "ident_type", limit: 255
|
||||
t.string "ident"
|
||||
t.string "ident_type"
|
||||
t.integer "created_by_id"
|
||||
t.integer "updated_by_id"
|
||||
t.string "auth_info", limit: 255
|
||||
t.string "name", limit: 255
|
||||
t.string "org_name", limit: 255
|
||||
t.string "auth_info"
|
||||
t.string "name"
|
||||
t.string "org_name"
|
||||
t.integer "registrar_id"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "countries", force: :cascade do |t|
|
||||
t.string "iso", limit: 255
|
||||
t.string "name", limit: 255
|
||||
t.string "iso"
|
||||
t.string "name"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "delayed_jobs", force: :cascade do |t|
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.integer "attempts", default: 0, null: false
|
||||
t.text "handler", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.integer "attempts", default: 0, null: false
|
||||
t.text "handler", null: false
|
||||
t.text "last_error"
|
||||
t.datetime "run_at"
|
||||
t.datetime "locked_at"
|
||||
t.datetime "failed_at"
|
||||
t.string "locked_by", limit: 255
|
||||
t.string "queue", limit: 255
|
||||
t.string "locked_by"
|
||||
t.string "queue"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
@ -134,10 +138,14 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
|
||||
create_table "delegation_signers", force: :cascade do |t|
|
||||
t.integer "domain_id"
|
||||
t.string "key_tag", limit: 255
|
||||
t.string "key_tag"
|
||||
t.integer "alg"
|
||||
t.integer "digest_type"
|
||||
t.string "digest", limit: 255
|
||||
t.string "digest"
|
||||
end
|
||||
|
||||
create_table "depricated_versions", force: :cascade do |t|
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "dnskeys", force: :cascade do |t|
|
||||
|
@ -147,41 +155,36 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
t.integer "alg"
|
||||
t.text "public_key"
|
||||
t.integer "delegation_signer_id"
|
||||
t.string "ds_key_tag", limit: 255
|
||||
t.string "ds_key_tag"
|
||||
t.integer "ds_alg"
|
||||
t.integer "ds_digest_type"
|
||||
t.string "ds_digest", limit: 255
|
||||
t.string "ds_digest"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "domain_contacts", force: :cascade do |t|
|
||||
t.integer "contact_id"
|
||||
t.integer "domain_id"
|
||||
t.string "contact_type", limit: 255
|
||||
t.string "contact_type"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "contact_code_cache", limit: 255
|
||||
t.string "contact_code_cache"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "domain_status_versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
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: :cascade do |t|
|
||||
t.integer "domain_id"
|
||||
t.string "description", limit: 255
|
||||
t.string "value", limit: 255
|
||||
t.string "description"
|
||||
t.string "value"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "domain_transfers", force: :cascade do |t|
|
||||
t.integer "domain_id"
|
||||
t.string "status", limit: 255
|
||||
t.string "status"
|
||||
t.datetime "transfer_requested_at"
|
||||
t.datetime "transferred_at"
|
||||
t.integer "transfer_from_id"
|
||||
|
@ -189,39 +192,38 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "wait_until"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "domain_versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
t.text "object"
|
||||
t.datetime "created_at"
|
||||
t.text "snapshot"
|
||||
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: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "name"
|
||||
t.integer "registrar_id"
|
||||
t.datetime "registered_at"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
t.string "status"
|
||||
>>>>>>> c010000bfec582db543f6a89f263e92b7611c7ef
|
||||
t.datetime "valid_from"
|
||||
t.datetime "valid_to"
|
||||
t.integer "owner_contact_id"
|
||||
t.string "auth_info", limit: 255
|
||||
t.string "auth_info"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "name_dirty", limit: 255
|
||||
t.string "name_puny", limit: 255
|
||||
t.string "name_dirty"
|
||||
t.string "name_puny"
|
||||
t.integer "period"
|
||||
t.string "period_unit", limit: 1
|
||||
<<<<<<< HEAD
|
||||
t.string "status"
|
||||
=======
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
>>>>>>> c010000bfec582db543f6a89f263e92b7611c7ef
|
||||
end
|
||||
|
||||
create_table "epp_sessions", force: :cascade do |t|
|
||||
t.string "session_id", limit: 255
|
||||
t.string "session_id"
|
||||
t.text "data"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
|
@ -233,67 +235,369 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
create_table "keyrelays", force: :cascade do |t|
|
||||
t.integer "domain_id"
|
||||
t.datetime "pa_date"
|
||||
t.string "key_data_flags", limit: 255
|
||||
t.string "key_data_protocol", limit: 255
|
||||
t.string "key_data_alg", limit: 255
|
||||
t.string "key_data_flags"
|
||||
t.string "key_data_protocol"
|
||||
t.string "key_data_alg"
|
||||
t.text "key_data_public_key"
|
||||
t.string "auth_info_pw", limit: 255
|
||||
t.string "expiry_relative", limit: 255
|
||||
t.string "auth_info_pw"
|
||||
t.string "expiry_relative"
|
||||
t.datetime "expiry_absolute"
|
||||
t.integer "requester_id"
|
||||
t.integer "accepter_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "legal_documents", force: :cascade do |t|
|
||||
t.string "document_type", limit: 255
|
||||
t.string "document_type"
|
||||
t.text "body"
|
||||
t.integer "documentable_id"
|
||||
t.string "documentable_type", limit: 255
|
||||
t.string "documentable_type"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "log_addresses", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_addresses", ["item_type", "item_id"], name: "index_log_addresses_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_addresses", ["whodunnit"], name: "index_log_addresses_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_api_users", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_api_users", ["item_type", "item_id"], name: "index_log_api_users_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_api_users", ["whodunnit"], name: "index_log_api_users_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_contact_disclosures", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_contact_disclosures", ["item_type", "item_id"], name: "index_log_contact_disclosures_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_contact_disclosures", ["whodunnit"], name: "index_log_contact_disclosures_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_contact_statuses", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_contact_statuses", ["item_type", "item_id"], name: "index_log_contact_statuses_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_contact_statuses", ["whodunnit"], name: "index_log_contact_statuses_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_contacts", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_contacts", ["item_type", "item_id"], name: "index_log_contacts_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_contacts", ["whodunnit"], name: "index_log_contacts_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_countries", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_countries", ["item_type", "item_id"], name: "index_log_countries_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_countries", ["whodunnit"], name: "index_log_countries_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_dnskeys", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_dnskeys", ["item_type", "item_id"], name: "index_log_dnskeys_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_dnskeys", ["whodunnit"], name: "index_log_dnskeys_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_domain_contacts", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_domain_contacts", ["item_type", "item_id"], name: "index_log_domain_contacts_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_domain_contacts", ["whodunnit"], name: "index_log_domain_contacts_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_domain_statuses", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_domain_statuses", ["item_type", "item_id"], name: "index_log_domain_statuses_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_domain_statuses", ["whodunnit"], name: "index_log_domain_statuses_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_domain_transfers", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_domain_transfers", ["item_type", "item_id"], name: "index_log_domain_transfers_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_domain_transfers", ["whodunnit"], name: "index_log_domain_transfers_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_domains", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.text "nameserver_ids", default: [], array: true
|
||||
t.text "tech_contact_ids", default: [], array: true
|
||||
t.text "admin_contact_ids", default: [], array: true
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_domains", ["item_type", "item_id"], name: "index_log_domains_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_domains", ["whodunnit"], name: "index_log_domains_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_keyrelays", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_keyrelays", ["item_type", "item_id"], name: "index_log_keyrelays_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_keyrelays", ["whodunnit"], name: "index_log_keyrelays_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_legal_documents", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_legal_documents", ["item_type", "item_id"], name: "index_log_legal_documents_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_legal_documents", ["whodunnit"], name: "index_log_legal_documents_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_messages", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_messages", ["item_type", "item_id"], name: "index_log_messages_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_messages", ["whodunnit"], name: "index_log_messages_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_nameservers", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_nameservers", ["item_type", "item_id"], name: "index_log_nameservers_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_nameservers", ["whodunnit"], name: "index_log_nameservers_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_registrars", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_registrars", ["item_type", "item_id"], name: "index_log_registrars_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_registrars", ["whodunnit"], name: "index_log_registrars_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_reserved_domains", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_reserved_domains", ["item_type", "item_id"], name: "index_log_reserved_domains_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_reserved_domains", ["whodunnit"], name: "index_log_reserved_domains_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_settings", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_settings", ["item_type", "item_id"], name: "index_log_settings_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_settings", ["whodunnit"], name: "index_log_settings_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_users", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_users", ["item_type", "item_id"], name: "index_log_users_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_users", ["whodunnit"], name: "index_log_users_on_whodunnit", using: :btree
|
||||
|
||||
create_table "log_zonefile_settings", force: :cascade do |t|
|
||||
t.string "item_type", null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", null: false
|
||||
t.string "whodunnit"
|
||||
t.json "object"
|
||||
t.json "object_changes"
|
||||
t.datetime "created_at"
|
||||
t.string "session"
|
||||
t.json "children"
|
||||
end
|
||||
|
||||
add_index "log_zonefile_settings", ["item_type", "item_id"], name: "index_log_zonefile_settings_on_item_type_and_item_id", using: :btree
|
||||
add_index "log_zonefile_settings", ["whodunnit"], name: "index_log_zonefile_settings_on_whodunnit", using: :btree
|
||||
|
||||
create_table "messages", force: :cascade do |t|
|
||||
t.integer "registrar_id"
|
||||
t.string "body", limit: 255
|
||||
t.string "attached_obj_type", limit: 255
|
||||
t.string "attached_obj_id", limit: 255
|
||||
t.string "body"
|
||||
t.string "attached_obj_type"
|
||||
t.string "attached_obj_id"
|
||||
t.boolean "queued"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "nameserver_versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
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: :cascade do |t|
|
||||
t.string "hostname", limit: 255
|
||||
t.string "ipv4", limit: 255
|
||||
t.string "hostname"
|
||||
t.string "ipv4"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "ipv6", limit: 255
|
||||
t.string "ipv6"
|
||||
t.integer "domain_id"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "registrars", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "reg_no", limit: 255
|
||||
t.string "vat_no", limit: 255
|
||||
t.string "address", limit: 255
|
||||
t.string "name"
|
||||
t.string "reg_no"
|
||||
t.string "vat_no"
|
||||
t.string "address"
|
||||
t.integer "country_id"
|
||||
t.string "billing_address", limit: 255
|
||||
t.string "billing_address"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
t.string "phone"
|
||||
t.string "email"
|
||||
t.string "billing_email"
|
||||
|
@ -301,35 +605,40 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
end
|
||||
|
||||
create_table "reserved_domains", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "name"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
create_table "settings", force: :cascade do |t|
|
||||
t.string "var", limit: 255, null: false
|
||||
t.string "var", null: false
|
||||
t.text "value"
|
||||
t.integer "thing_id"
|
||||
t.string "thing_type", limit: 30
|
||||
t.string "thing_type", limit: 30
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
add_index "settings", ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true, using: :btree
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "username", limit: 255
|
||||
t.string "password", limit: 255
|
||||
t.string "username"
|
||||
t.string "password"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "email", limit: 255
|
||||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.string "email"
|
||||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "identity_code", limit: 255
|
||||
t.string "identity_code"
|
||||
t.integer "country_id"
|
||||
<<<<<<< HEAD
|
||||
t.string "roles", array: true
|
||||
t.string "country_code"
|
||||
end
|
||||
|
@ -338,35 +647,30 @@ ActiveRecord::Schema.define(version: 20150202084444) do
|
|||
t.integer "version_id"
|
||||
t.string "foreign_key_name", null: false
|
||||
t.integer "foreign_key_id"
|
||||
=======
|
||||
t.string "roles", array: true
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
>>>>>>> c010000bfec582db543f6a89f263e92b7611c7ef
|
||||
end
|
||||
|
||||
add_index "version_associations", ["foreign_key_name", "foreign_key_id"], name: "index_version_associations_on_foreign_key", using: :btree
|
||||
add_index "version_associations", ["version_id"], name: "index_version_associations_on_version_id", using: :btree
|
||||
|
||||
create_table "versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
t.string "event", limit: 255, null: false
|
||||
t.string "whodunnit", limit: 255
|
||||
t.text "object"
|
||||
t.datetime "created_at"
|
||||
t.integer "transaction_id"
|
||||
t.text "depricated_table_but_somehow_paper_trail_tests_fails_without_it"
|
||||
end
|
||||
|
||||
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
|
||||
add_index "versions", ["transaction_id"], name: "index_versions_on_transaction_id", using: :btree
|
||||
|
||||
create_table "zonefile_settings", force: :cascade do |t|
|
||||
t.string "origin", limit: 255
|
||||
t.string "origin"
|
||||
t.integer "ttl"
|
||||
t.integer "refresh"
|
||||
t.integer "retry"
|
||||
t.integer "expire"
|
||||
t.integer "minimum_ttl"
|
||||
t.string "email", limit: 255
|
||||
t.string "master_nameserver", limit: 255
|
||||
t.string "email"
|
||||
t.string "master_nameserver"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "creator_str"
|
||||
t.string "updator_str"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
23
db/seeds.rb
23
db/seeds.rb
|
@ -1,11 +1,5 @@
|
|||
# This file should contain all the record creation needed to seed the database with its default values.
|
||||
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
||||
# Mayor.create(name: 'Emanuel', city: cities.first)
|
||||
|
||||
Country.where(name: 'Estonia', iso: 'EE').first_or_create!
|
||||
Country.where(name: 'Latvia', iso: 'LV').first_or_create!
|
||||
|
||||
|
@ -13,29 +7,31 @@ registrar1 = Registrar.where(
|
|||
name: 'Registrar First AS',
|
||||
reg_no: '10300220',
|
||||
address: 'Pärnu mnt 2, Tallinna linn, Harju maakond, 11415',
|
||||
email: 'registrar1@example.com',
|
||||
country: Country.first
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
ApiUser.where(
|
||||
username: 'registrar1',
|
||||
password: 'test1',
|
||||
active: true,
|
||||
registrar: registrar1
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
registrar2 = Registrar.where(
|
||||
name: 'Registrar Second AS',
|
||||
reg_no: '10529229',
|
||||
address: 'Vabaduse pst 32, 11316 Tallinn',
|
||||
email: 'registrar2@example.com',
|
||||
country: Country.first
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
ApiUser.where(
|
||||
username: 'registrar2',
|
||||
password: 'test2',
|
||||
active: true,
|
||||
registrar: registrar2
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
User.where(
|
||||
username: 'user1',
|
||||
|
@ -43,7 +39,7 @@ User.where(
|
|||
email: 'user1@example.ee',
|
||||
identity_code: '37810013855',
|
||||
country: Country.where(name: 'Estonia').first
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
User.where(
|
||||
username: 'user2',
|
||||
|
@ -51,7 +47,7 @@ User.where(
|
|||
email: 'user2@example.ee',
|
||||
identity_code: '37810010085',
|
||||
country: Country.where(name: 'Estonia').first
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
User.where(
|
||||
username: 'user3',
|
||||
|
@ -59,7 +55,6 @@ User.where(
|
|||
email: 'user3@example.ee',
|
||||
identity_code: '37810010727',
|
||||
country: Country.where(name: 'Estonia').first
|
||||
).first_or_create
|
||||
).first_or_create!
|
||||
|
||||
User.update_all(roles: ['admin'])
|
||||
# Setting.whois_enabled = true only uncomment this if you wish whois
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue