Convert DomainBase's contacts to VKeys (#574)

* Convert DomainBase's contacts to VKeys

Convert usage of DomainBase contacts from Key to VKey.  This is the same
change as done for nameserver hosts, as it affects all external interfaces.
As with nameserver hosts, we preserve the existing representation so as not to
afffect the datastore representation.
This commit is contained in:
Michael Muller 2020-05-07 11:19:15 -04:00 committed by GitHub
parent 40a4c3101c
commit 04f429c4d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 399 additions and 173 deletions

View file

@ -0,0 +1,38 @@
-- Copyright 2020 The Nomulus Authors. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
ALTER TABLE "Domain" ADD COLUMN admin_contact text;
ALTER TABLE "Domain" ADD COLUMN billing_contact text;
ALTER TABLE "Domain" ADD COLUMN registrant_contact text;
ALTER TABLE "Domain" ADD COLUMN tech_contact text;
alter table if exists "Domain"
add constraint fk_domain_admin_contact
foreign key (admin_contact)
references "Contact";
alter table if exists "Domain"
add constraint fk_domain_billing_contact
foreign key (billing_contact)
references "Contact";
alter table if exists "Domain"
add constraint fk_domain_registrant_contact
foreign key (registrant_contact)
references "Contact";
alter table if exists "Domain"
add constraint fk_domain_tech_contact
foreign key (tech_contact)
references "Contact";

View file

@ -100,8 +100,10 @@
last_epp_update_client_id text,
last_epp_update_time timestamptz,
statuses text[],
admin_contact text,
auth_info_repo_id text,
auth_info_value text,
billing_contact text,
fully_qualified_domain_name text,
idn_table_name text,
last_transfer_time timestamptz,
@ -109,9 +111,11 @@
launch_notice_expiration_time timestamptz,
launch_notice_tcn_id text,
launch_notice_validator_id text,
registrant_contact text,
registration_expiration_time timestamptz,
smd_id text,
subordinate_hosts text[],
tech_contact text,
tld text,
primary key (repo_id)
);

View file

@ -165,7 +165,11 @@ CREATE TABLE public."Domain" (
registration_expiration_time timestamp with time zone,
smd_id text,
subordinate_hosts text[],
tld text
tld text,
admin_contact text,
billing_contact text,
registrant_contact text,
tech_contact text
);
@ -747,6 +751,38 @@ ALTER TABLE ONLY public."Contact"
ADD CONSTRAINT fk93c185fx7chn68uv7nl6uv2s0 FOREIGN KEY (current_sponsor_client_id) REFERENCES public."Registrar"(client_id);
--
-- Name: Domain fk_domain_admin_contact; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT fk_domain_admin_contact FOREIGN KEY (admin_contact) REFERENCES public."Contact"(repo_id);
--
-- Name: Domain fk_domain_billing_contact; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT fk_domain_billing_contact FOREIGN KEY (billing_contact) REFERENCES public."Contact"(repo_id);
--
-- Name: Domain fk_domain_registrant_contact; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT fk_domain_registrant_contact FOREIGN KEY (registrant_contact) REFERENCES public."Contact"(repo_id);
--
-- Name: Domain fk_domain_tech_contact; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT fk_domain_tech_contact FOREIGN KEY (tech_contact) REFERENCES public."Contact"(repo_id);
--
-- Name: DomainHost fk_domainhost_host_valid; Type: FK CONSTRAINT; Schema: public; Owner: -
--