Persist DomainBase.nsHosts VKeys to SQL (#541)

Persist nsHosts in Cloud SQL

Persist the VKey based nameserver hosts field of DomainBase in Cloud SQL with
foreign key constraints.
This commit is contained in:
Michael Muller 2020-04-20 13:03:12 -04:00 committed by GitHub
parent 7b874ad287
commit b9b55c8d6e
7 changed files with 229 additions and 4 deletions

View file

@ -67,6 +67,11 @@
primary key (repo_id)
);
create table "DomainHost" (
domain_repo_id text not null,
ns_host_v_keys text
);
create table "GracePeriod" (
id bigserial not null,
billing_event_one_time bytea,
@ -77,6 +82,27 @@
primary key (id)
);
create table "HostResource" (
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[],
fully_qualified_host_name text,
last_superordinate_change timestamptz,
last_transfer_time timestamptz,
superordinate_domain bytea,
primary key (repo_id)
);
create table "HostResource_inetAddresses" (
host_resource_repo_id text not null,
inet_addresses bytea
);
create table "Lock" (
resource_name text not null,
tld text not null,
@ -222,6 +248,16 @@ create index reservedlist_name_idx on "ReservedList" (name);
foreign key (revision_id)
references "ClaimsList";
alter table if exists "DomainHost"
add constraint FKeq1guccbre1yk3oosgp2io554
foreign key (domain_repo_id)
references "Domain";
alter table if exists "HostResource_inetAddresses"
add constraint FK6unwhfkcu3oq6q347fxvpagv
foreign key (host_resource_repo_id)
references "HostResource";
alter table if exists "PremiumEntry"
add constraint FKo0gw90lpo1tuee56l0nb6y6g5
foreign key (revision_id)