mirror of
https://github.com/google/nomulus
synced 2026-01-11 00:10:36 +00:00
* Get persistence of DomainBase actually working Fix all of the existing problems with DomainBase persistence: - Remove "final" keywords on getters that cause errors during startup. - Remove Transient from creationTime (since there's a converter for CreateAutoTimestamp) - Fix DesignatedContext persistence so that it only creates a single table. This is a lot more efficient given that these are many-to-one with their domains. - Add a flyway script, update the golden schema. - Create a unit test, add it to the integration test suite. * Changes request in review * Regenerated generated schema file. * Changes for review * Persist status value enum set * Changes in response to review * Changes requested in review * Fixes for #456 * Rename Domain "status" column to "statuses"
154 lines
5.1 KiB
Plaintext
154 lines
5.1 KiB
Plaintext
-- 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 "ClaimsEntry" (
|
|
revision_id int8 not null,
|
|
claim_key text not null,
|
|
domain_label text not null,
|
|
primary key (revision_id, domain_label)
|
|
);
|
|
|
|
create table "ClaimsList" (
|
|
revision_id bigserial not null,
|
|
creation_timestamp timestamptz not null,
|
|
tmdb_generation_time timestamptz not null,
|
|
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,
|
|
digest bytea,
|
|
digest_type int4 not null,
|
|
primary key (key_tag)
|
|
);
|
|
|
|
create table "Domain" (
|
|
repo_id text not null,
|
|
creation_client_id text,
|
|
creation_time timestamptz,
|
|
current_sponsor_client_id text,
|
|
deletion_time timestamptz,
|
|
last_epp_update_client_id text,
|
|
last_epp_update_time timestamptz,
|
|
statuses text[],
|
|
auth_info_repo_id text,
|
|
auth_info_value text,
|
|
fully_qualified_domain_name text,
|
|
idn_table_name text,
|
|
last_transfer_time timestamptz,
|
|
launch_notice_accepted_time timestamptz,
|
|
launch_notice_expiration_time timestamptz,
|
|
launch_notice_tcn_id text,
|
|
launch_notice_validator_id text,
|
|
registration_expiration_time timestamptz,
|
|
smd_id text,
|
|
subordinate_hosts text[],
|
|
tld text,
|
|
primary key (repo_id)
|
|
);
|
|
|
|
create table "GracePeriod" (
|
|
id bigserial not null,
|
|
billing_event_one_time bytea,
|
|
billing_event_recurring bytea,
|
|
client_id text,
|
|
expiration_time timestamptz,
|
|
type int4,
|
|
primary key (id)
|
|
);
|
|
|
|
create table "PremiumEntry" (
|
|
revision_id int8 not null,
|
|
domain_label text not null,
|
|
price numeric(19, 2) not null,
|
|
primary key (revision_id, domain_label)
|
|
);
|
|
|
|
create table "PremiumList" (
|
|
revision_id bigserial not null,
|
|
bloom_filter bytea not null,
|
|
creation_timestamp timestamptz not null,
|
|
currency text not null,
|
|
name text not null,
|
|
primary key (revision_id)
|
|
);
|
|
|
|
create table "RegistryLock" (
|
|
revision_id bigserial not null,
|
|
domain_name text not null,
|
|
is_superuser boolean not null,
|
|
last_update_timestamp timestamptz,
|
|
lock_completion_timestamp timestamptz,
|
|
lock_request_timestamp timestamptz not null,
|
|
registrar_id text not null,
|
|
registrar_poc_id text,
|
|
repo_id text not null,
|
|
unlock_completion_timestamp timestamptz,
|
|
unlock_request_timestamp timestamptz,
|
|
verification_code text not null,
|
|
primary key (revision_id)
|
|
);
|
|
|
|
create table "ReservedEntry" (
|
|
revision_id int8 not null,
|
|
comment text,
|
|
reservation_type int4 not null,
|
|
domain_label text not null,
|
|
primary key (revision_id, domain_label)
|
|
);
|
|
|
|
create table "ReservedList" (
|
|
revision_id bigserial not null,
|
|
creation_timestamp timestamptz not null,
|
|
name text not null,
|
|
should_publish boolean not null,
|
|
primary key (revision_id)
|
|
);
|
|
create index IDX8nr0ke9mrrx4ewj6pd2ag4rmr on "Domain" (creation_time);
|
|
create index IDX8ffrqm27qtj20jac056j7yq07 on "Domain" (current_sponsor_client_id);
|
|
create index IDX5mnf0wn20tno4b9do88j61klr on "Domain" (deletion_time);
|
|
create index IDX1rcgkdd777bpvj0r94sltwd5y on "Domain" (fully_qualified_domain_name);
|
|
create index IDXrwl38wwkli1j7gkvtywi9jokq on "Domain" (tld);
|
|
create index premiumlist_name_idx on "PremiumList" (name);
|
|
create index idx_registry_lock_verification_code on "RegistryLock" (verification_code);
|
|
create index idx_registry_lock_registrar_id on "RegistryLock" (registrar_id);
|
|
|
|
alter table if exists "RegistryLock"
|
|
add constraint idx_registry_lock_repo_id_revision_id unique (repo_id, revision_id);
|
|
create index reservedlist_name_idx on "ReservedList" (name);
|
|
|
|
alter table if exists "ClaimsEntry"
|
|
add constraint FK6sc6at5hedffc0nhdcab6ivuq
|
|
foreign key (revision_id)
|
|
references "ClaimsList";
|
|
|
|
alter table if exists "PremiumEntry"
|
|
add constraint FKo0gw90lpo1tuee56l0nb6y6g5
|
|
foreign key (revision_id)
|
|
references "PremiumList";
|
|
|
|
alter table if exists "ReservedEntry"
|
|
add constraint FKgq03rk0bt1hb915dnyvd3vnfc
|
|
foreign key (revision_id)
|
|
references "ReservedList";
|