mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 20:18:34 +02:00
Add schema and DAO for cursors in cloudsql (#370)
* Add schema for Cursor * Add CursorDao and CursorDaoTest * Fix comment on getTld * Change tld column to scope * Fix cursorTime to be converted to DateTime internally and other small fixes * Add a CursorType enum and a createGlobal constructor for Cursor * Rename flyway file * Use cursorType from common/Cursor.java and add null checks
This commit is contained in:
parent
bba5aff4b6
commit
2478a4a93b
8 changed files with 370 additions and 0 deletions
21
db/src/main/resources/sql/flyway/V11__create_cursor.sql
Normal file
21
db/src/main/resources/sql/flyway/V11__create_cursor.sql
Normal file
|
@ -0,0 +1,21 @@
|
|||
-- Copyright 2019 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.
|
||||
|
||||
create table "Cursor" (
|
||||
scope text not null,
|
||||
type text not null,
|
||||
cursor_time timestamptz not null,
|
||||
last_update_time timestamptz not null,
|
||||
primary key (scope, type)
|
||||
);
|
|
@ -26,6 +26,14 @@
|
|||
primary key (revision_id)
|
||||
);
|
||||
|
||||
create table "Cursor" (
|
||||
scope text not null,
|
||||
type text not null,
|
||||
cursor_time timestamptz not null,
|
||||
last_update_time timestamptz not null,
|
||||
primary key (scope, type)
|
||||
);
|
||||
|
||||
create table "DelegationSignerData" (
|
||||
key_tag int4 not null,
|
||||
algorithm int4 not null,
|
||||
|
|
|
@ -61,6 +61,18 @@ CREATE SEQUENCE public."ClaimsList_revision_id_seq"
|
|||
ALTER SEQUENCE public."ClaimsList_revision_id_seq" OWNED BY public."ClaimsList".revision_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: Cursor; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public."Cursor" (
|
||||
scope text NOT NULL,
|
||||
type text NOT NULL,
|
||||
cursor_time timestamp with time zone NOT NULL,
|
||||
last_update_time timestamp with time zone NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -228,6 +240,14 @@ ALTER TABLE ONLY public."ClaimsList"
|
|||
ADD CONSTRAINT "ClaimsList_pkey" PRIMARY KEY (revision_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: Cursor Cursor_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public."Cursor"
|
||||
ADD CONSTRAINT "Cursor_pkey" PRIMARY KEY (scope, type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: PremiumEntry PremiumEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue