mirror of
https://github.com/google/nomulus.git
synced 2025-06-22 20:30:46 +02:00
Make VKey persist to datastore as a key (#591)
* Make VKey persist to datastore as a key Convert nsHosts entirely to VKey as a proof-of-concept. Tested as follows: 1) Deployed to crash, verified that nameservers were visible for several domains (indicating that we are able to load a set of Keys as VKeys) 2) Updated the set of nameservers for a domain (removing some initial hosts) and verified that the changes went through. 3) Deployed the old version to crash, verified that I was able to retrieve the newly saved VKeys as Keys. 4) Modified the hosts for the same domain (adding back one of the hosts) and verified that the change took effect. 5) Redeployed this change to crash, again updated the nameservers to add another host. 6) Again restored the old version, verified that the new hosts were visible. * Changes in response to review * Convert to a single VKeyTranslatorFactory instance * Moved vkey field rename to V25
This commit is contained in:
parent
afafe60767
commit
b54c19e6c4
9 changed files with 69 additions and 152 deletions
22
db/src/main/resources/sql/flyway/V25__rename_vkey_fields.sql
Normal file
22
db/src/main/resources/sql/flyway/V25__rename_vkey_fields.sql
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- 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 "DomainHost" DROP CONSTRAINT FK_DomainHost_host_valid;
|
||||
ALTER TABLE "DomainHost" ADD COLUMN ns_hosts text;
|
||||
ALTER TABLE "DomainHost" DROP COLUMN ns_host_v_keys;
|
||||
ALTER TABLE "DomainHost"
|
||||
ADD CONSTRAINT FK_DomainHost_host_valid
|
||||
FOREIGN KEY (ns_hosts)
|
||||
REFERENCES "HostResource";
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
|
||||
create table "DomainHost" (
|
||||
domain_repo_id text not null,
|
||||
ns_host_v_keys text
|
||||
ns_hosts text
|
||||
);
|
||||
|
||||
create table "GracePeriod" (
|
||||
|
|
|
@ -179,7 +179,7 @@ CREATE TABLE public."Domain" (
|
|||
|
||||
CREATE TABLE public."DomainHost" (
|
||||
domain_repo_id text NOT NULL,
|
||||
ns_host_v_keys text
|
||||
ns_hosts text
|
||||
);
|
||||
|
||||
|
||||
|
@ -788,7 +788,7 @@ ALTER TABLE ONLY public."Domain"
|
|||
--
|
||||
|
||||
ALTER TABLE ONLY public."DomainHost"
|
||||
ADD CONSTRAINT fk_domainhost_host_valid FOREIGN KEY (ns_host_v_keys) REFERENCES public."HostResource"(repo_id);
|
||||
ADD CONSTRAINT fk_domainhost_host_valid FOREIGN KEY (ns_hosts) REFERENCES public."HostResource"(repo_id);
|
||||
|
||||
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue