mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Merge pull request #1169 from internetee/remove-unused-columns-from-log-domains
Remove unused columns from `log_domains` database table
This commit is contained in:
commit
59d6e3e125
4 changed files with 12 additions and 8 deletions
|
@ -87,8 +87,7 @@ class LegalDocument < ActiveRecord::Base
|
|||
|
||||
contact_ids = DomainVersion.where(item_id: orig_legal.documentable_id).distinct.
|
||||
pluck("object->>'registrant_id'", "object_changes->>'registrant_id'",
|
||||
"children->>'tech_contacts'", "children->>'admin_contacts'",
|
||||
"tech_contact_ids", "admin_contact_ids").flatten.uniq
|
||||
"children->>'tech_contacts'", "children->>'admin_contacts'").flatten.uniq
|
||||
contact_ids = contact_ids.map{|id|
|
||||
case id
|
||||
when Hash
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class RemoveUnusedColumnsFromLogDomains < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :log_domains, :nameserver_ids
|
||||
remove_column :log_domains, :admin_contact_ids
|
||||
remove_column :log_domains, :tech_contact_ids
|
||||
end
|
||||
end
|
|
@ -1539,9 +1539,6 @@ CREATE TABLE public.log_domains (
|
|||
object jsonb,
|
||||
object_changes json,
|
||||
created_at timestamp without time zone,
|
||||
nameserver_ids text[] DEFAULT '{}'::text[],
|
||||
tech_contact_ids text[] DEFAULT '{}'::text[],
|
||||
admin_contact_ids text[] DEFAULT '{}'::text[],
|
||||
session character varying,
|
||||
children json,
|
||||
uuid character varying
|
||||
|
@ -4942,3 +4939,5 @@ INSERT INTO schema_migrations (version) VALUES ('20190322152123');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20190322152529');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20190415120246');
|
||||
|
||||
|
|
|
@ -29,12 +29,11 @@ class DomainVersionsTest < ApplicationSystemTestCase
|
|||
VALUES (54, 54, '2018-06-23T12:14:02.732+03:00', 54, 'transfer_code');
|
||||
|
||||
INSERT INTO log_domains (item_type, item_id, event, whodunnit, object,
|
||||
object_changes, created_at, nameserver_ids, tech_contact_ids,
|
||||
admin_contact_ids, session, children)
|
||||
object_changes, created_at, session, children)
|
||||
VALUES ('Domain', 54, 'update', '1-AdminUser',
|
||||
'{"id": 54, "registrar_id": 54, "valid_to": "2018-07-23T12:14:05.583+03:00", "registrant_id": 54, "transfer_code": "transfer_code", "valid_from": "2017-07-23T12:14:05.583+03:00"}',
|
||||
'{"foo": "bar", "other_made_up_field": "value"}',
|
||||
'2018-04-23 15:50:48.113491', '{}', '{}', '{}', '2018-04-23 12:44:56',
|
||||
'2018-04-23 15:50:48.113491', '2018-04-23 12:44:56',
|
||||
'{"null_fracdmin_contacts":[108],"tech_contacts":[109],"nameservers":[],"dnskeys":[],"legal_documents":[null],"registrant":[1]}'
|
||||
)
|
||||
SQL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue