mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 03:06:01 +02:00
Add Cloud SQL schema for premium lists (#254)
* Re-add other schema classes * Add Cloud SQL schema for premium lists This won't work quite yet, pending a solution for the type translator issue (which will be needed for the currency field, and potentially others).
This commit is contained in:
parent
725df06d2b
commit
c55e3422c2
7 changed files with 192 additions and 14 deletions
|
@ -12,6 +12,19 @@
|
|||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
create table ClaimsEntry (
|
||||
revision_id int8 not null,
|
||||
claim_key varchar(255) not null,
|
||||
domain_label varchar(255) not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
|
||||
create table ClaimsList (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamp not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
create table DelegationSignerData (
|
||||
keyTag int4 not null,
|
||||
algorithm int4 not null,
|
||||
|
@ -108,6 +121,20 @@
|
|||
primary key (id)
|
||||
);
|
||||
|
||||
create table PremiumEntry (
|
||||
revision_id int8 not null,
|
||||
price numeric(19, 2) not null,
|
||||
domain_label varchar(255) not null,
|
||||
primary key (revision_id, domain_label)
|
||||
);
|
||||
|
||||
create table PremiumList (
|
||||
revision_id bigserial not null,
|
||||
creation_timestamp timestamp not null,
|
||||
currency bytea not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
alter table domain_DelegationSignerData
|
||||
add constraint UK_q2uk7gpqskey3t2w11w2o7x9f unique (dsData_keyTag);
|
||||
|
||||
|
@ -117,6 +144,11 @@
|
|||
alter table domain_GracePeriod
|
||||
add constraint UK_74osb0s7br4x734ecpdk8caxx unique (gracePeriods_id);
|
||||
|
||||
alter table ClaimsEntry
|
||||
add constraint FKlugn0q07ayrtar87dqi3vs3c8
|
||||
foreign key (revision_id)
|
||||
references ClaimsList;
|
||||
|
||||
alter table domain_DelegationSignerData
|
||||
add constraint FK6p262lfef34yht2ok65rqfoiy
|
||||
foreign key (dsData_keyTag)
|
||||
|
@ -161,3 +193,8 @@
|
|||
add constraint FK3p6gm6lbx46s41hl9wfme77sr
|
||||
foreign key (DomainBase_repoId)
|
||||
references domain;
|
||||
|
||||
alter table PremiumEntry
|
||||
add constraint FKqebdja3jkx9c9cnqnrw9g9ocu
|
||||
foreign key (revision_id)
|
||||
references PremiumList;
|
||||
|
|
28
db/src/main/resources/sql/schema/premium_list.sql
Normal file
28
db/src/main/resources/sql/schema/premium_list.sql
Normal file
|
@ -0,0 +1,28 @@
|
|||
-- 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 "PremiumList" (
|
||||
revision_id BIGSERIAL NOT NULL,
|
||||
creation_timestamp TIMESTAMPTZ NOT NULL,
|
||||
currency TEXT NOT NULL,
|
||||
PRIMARY KEY (revision_id)
|
||||
);
|
||||
|
||||
CREATE TABLE "PremiumEntry" (
|
||||
revision_id BIGSERIAL NOT NULL,
|
||||
price NUMERIC(12, 2) NOT NULL,
|
||||
domain_label TEXT NOT NULL,
|
||||
primary key (revision_id, domain_label),
|
||||
FOREIGN KEY (revision_id) REFERENCES "PremiumList"(revision_id)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue