Add loadOnlyOf method to tm() (#1162)

* Add loadOnlyOf method to tm()

In addition there's a bit of a refator of SqlReplayCheckpoint to make it
more in line with the other singletons. This method is useful for the
singleton classes where we expect at most one entity to exist, e.g.
ServerSecret.
This commit is contained in:
gbrodman 2021-05-20 10:59:01 -04:00 committed by GitHub
parent ae45462f11
commit 5dbb3b8ff4
13 changed files with 4012 additions and 3955 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -93,3 +93,4 @@ V92__singletons.sql
V93__defer_all_fkeys.sql
V94__rename_lock_scope.sql
V95__add_contacts_indexes_on_domain.sql
V96__rename_sql_checkpoint_fields.sql

View file

@ -0,0 +1,15 @@
-- Copyright 2021 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 IF EXISTS "SqlReplayCheckpoint" RENAME revision_id TO id;

View file

@ -695,9 +695,9 @@
);
create table "SqlReplayCheckpoint" (
revision_id int8 not null,
last_replay_time timestamptz,
primary key (revision_id)
id int8 not null,
last_replay_time timestamptz not null,
primary key (id)
);
create table "Tld" (

View file

@ -998,7 +998,7 @@ ALTER SEQUENCE public."SignedMarkRevocationList_revision_id_seq" OWNED BY public
--
CREATE TABLE public."SqlReplayCheckpoint" (
revision_id bigint NOT NULL,
id bigint NOT NULL,
last_replay_time timestamp with time zone NOT NULL
);
@ -1415,7 +1415,7 @@ ALTER TABLE ONLY public."SignedMarkRevocationList"
--
ALTER TABLE ONLY public."SqlReplayCheckpoint"
ADD CONSTRAINT "SqlReplayCheckpoint_pkey" PRIMARY KEY (revision_id);
ADD CONSTRAINT "SqlReplayCheckpoint_pkey" PRIMARY KEY (id);
--