Create a converter for sets of InetAddresses and use it in HostResource (#612)

* Create a converter for sets of inetAddresses and use it in HostResource

This can just be a set of strings where each string represents an
address;  there's no need for it to be a separate table. This allows
for simplification of the SQL schema.

* Regenerate golden SQL file after renaming v28 -> v29

* Add more tests and rename a typo in the file

* Refactor common test code and use tm methods

* Use JUnit5 API

* Rename test entity
This commit is contained in:
gbrodman 2020-06-10 13:04:20 -04:00 committed by GitHub
parent fdac686250
commit 40b14fb695
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 141 additions and 31 deletions

View file

@ -0,0 +1,17 @@
-- 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 "HostResource" ADD COLUMN inet_addresses text[];
DROP TABLE IF EXISTS "HostResource_inetAddresses";

View file

@ -225,17 +225,13 @@
last_epp_update_time timestamptz,
statuses text[],
fully_qualified_host_name text,
inet_addresses text[],
last_superordinate_change timestamptz,
last_transfer_time timestamptz,
superordinate_domain text,
primary key (repo_id)
);
create table "HostResource_inetAddresses" (
host_resource_repo_id text not null,
inet_addresses bytea
);
create table "Lock" (
resource_name text not null,
tld text not null,
@ -437,11 +433,6 @@ create index reservedlist_name_idx on "ReservedList" (name);
foreign key (domain_repo_id)
references "Domain";
alter table if exists "HostResource_inetAddresses"
add constraint FK6unwhfkcu3oq6q347fxvpagv
foreign key (host_resource_repo_id)
references "HostResource";
alter table if exists "PremiumEntry"
add constraint FKo0gw90lpo1tuee56l0nb6y6g5
foreign key (revision_id)

View file

@ -348,17 +348,8 @@ CREATE TABLE public."HostResource" (
fully_qualified_host_name text,
last_superordinate_change timestamp with time zone,
last_transfer_time timestamp with time zone,
superordinate_domain text
);
--
-- Name: HostResource_inetAddresses; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."HostResource_inetAddresses" (
host_resource_repo_id text NOT NULL,
inet_addresses bytea
superordinate_domain text,
inet_addresses text[]
);
@ -1095,14 +1086,6 @@ ALTER TABLE ONLY public."ClaimsEntry"
ADD CONSTRAINT fk6sc6at5hedffc0nhdcab6ivuq FOREIGN KEY (revision_id) REFERENCES public."ClaimsList"(revision_id);
--
-- Name: HostResource_inetAddresses fk6unwhfkcu3oq6q347fxvpagv; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."HostResource_inetAddresses"
ADD CONSTRAINT fk6unwhfkcu3oq6q347fxvpagv FOREIGN KEY (host_resource_repo_id) REFERENCES public."HostResource"(repo_id);
--
-- Name: Contact fk93c185fx7chn68uv7nl6uv2s0; Type: FK CONSTRAINT; Schema: public; Owner: -
--