Add SQL schema for DelegationSignerData (#713)

* Add SQL schema for DelegationSignerData

* Remove join table

* Rebased on HEAD

* Rebase on head
This commit is contained in:
Shicong Huang 2020-10-09 10:22:31 -04:00 committed by GitHub
parent 035431c90d
commit 89cc3e576d
11 changed files with 242 additions and 30 deletions

View file

@ -227,11 +227,12 @@
);
create table "DelegationSignerData" (
key_tag int4 not null,
domain_repo_id text not null,
key_tag int4 not null,
algorithm int4 not null,
digest bytea,
digest bytea not null,
digest_type int4 not null,
primary key (key_tag)
primary key (domain_repo_id, key_tag)
);
create table "Domain" (
@ -668,6 +669,7 @@ create index IDXo1xdtpij2yryh0skxe9v91sep on "ContactHistory" (creation_time);
create index IDXhp33wybmb6tbpr1bq7ttwk8je on "ContactHistory" (history_registrar_id);
create index IDX9q53px6r302ftgisqifmc6put on "ContactHistory" (history_type);
create index IDXsudwswtwqnfnx2o1hx4s0k0g5 on "ContactHistory" (history_modification_time);
create index IDXhlqqd5uy98cjyos72d81x9j95 on "DelegationSignerData" (domain_repo_id);
create index IDX8nr0ke9mrrx4ewj6pd2ag4rmr on "Domain" (creation_time);
create index IDXhsjqiy2lyobfymplb28nm74lm on "Domain" (current_sponsor_registrar_id);
create index IDX5mnf0wn20tno4b9do88j61klr on "Domain" (deletion_time);
@ -705,6 +707,11 @@ create index spec11threatmatch_check_date_idx on "Spec11ThreatMatch" (check_date
foreign key (revision_id)
references "ClaimsList";
alter table if exists "DelegationSignerData"
add constraint FKtr24j9v14ph2mfuw2gsmt12kq
foreign key (domain_repo_id)
references "Domain";
alter table if exists "DomainHistoryHost"
add constraint FKa9woh3hu8gx5x0vly6bai327n
foreign key (domain_history_domain_repo_id, domain_history_history_revision_id)