Add the schema and DAO for Locks in CloudSQL (#462)

* Add the schema and DAO for Locks in CloudSQL

* Addresses some comments

* Change number on flyway file

* Small changes

* More small changes

* Use checkArgumentNotNull instead of checkNotNull

* Address comments

* fix javadocs

* update persistence
This commit is contained in:
sarahcaseybot
2020-02-13 10:22:10 -05:00
committed by GitHub
parent 62433c2238
commit 22a879e655
8 changed files with 392 additions and 0 deletions
@@ -77,6 +77,15 @@
primary key (id)
);
create table "Lock" (
resource_name text not null,
tld text not null,
acquired_time timestamptz not null,
expiration_time timestamptz not null,
request_log_id text not null,
primary key (resource_name, tld)
);
create table "PremiumEntry" (
revision_id int8 not null,
domain_label text not null,
@@ -116,6 +116,19 @@ CREATE TABLE public."Domain" (
);
--
-- Name: Lock; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."Lock" (
resource_name text NOT NULL,
tld text NOT NULL,
acquired_time timestamp with time zone NOT NULL,
expiration_time timestamp with time zone NOT NULL,
request_log_id text NOT NULL
);
--
-- Name: PremiumEntry; Type: TABLE; Schema: public; Owner: -
--
@@ -374,6 +387,14 @@ ALTER TABLE ONLY public."Domain"
ADD CONSTRAINT "Domain_pkey" PRIMARY KEY (repo_id);
--
-- Name: Lock Lock_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Lock"
ADD CONSTRAINT "Lock_pkey" PRIMARY KEY (resource_name, tld);
--
-- Name: PremiumEntry PremiumEntry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--