Change primary key of DelegationSignerData and add its history table (#841)

* Change primary key of DelegationSignerData and add its history table

* Change primary key and resolve comments

* Rebase on HEAD
This commit is contained in:
Shicong Huang 2020-10-29 16:19:15 -04:00 committed by GitHub
parent 2000ea2d60
commit b8d913ef64
14 changed files with 4405 additions and 3505 deletions

View file

@ -227,12 +227,12 @@
);
create table "DelegationSignerData" (
domain_repo_id text not null,
key_tag int4 not null,
algorithm int4 not null,
algorithm int4 not null,
digest bytea not null,
digest_type int4 not null,
primary key (domain_repo_id, key_tag)
domain_repo_id text not null,
key_tag int4 not null,
primary key (algorithm, digest, digest_type, domain_repo_id, key_tag)
);
create table "Domain" (
@ -291,6 +291,17 @@
primary key (repo_id)
);
create table "DomainDsDataHistory" (
ds_data_history_revision_id int8 not null,
algorithm int4 not null,
digest bytea not null,
digest_type int4 not null,
domain_history_revision_id int8 not null,
domain_repo_id text,
key_tag int4 not null,
primary key (ds_data_history_revision_id)
);
create table "DomainHistory" (
domain_repo_id text not null,
history_revision_id int8 not null,
@ -729,6 +740,11 @@ create index spec11threatmatch_check_date_idx on "Spec11ThreatMatch" (check_date
foreign key (domain_repo_id)
references "Domain";
alter table if exists "DomainDsDataHistory"
add constraint FKo4ilgyyfnvppbpuivus565i0j
foreign key (domain_repo_id, domain_history_revision_id)
references "DomainHistory";
alter table if exists "DomainHistoryHost"
add constraint FKa9woh3hu8gx5x0vly6bai327n
foreign key (domain_history_domain_repo_id, domain_history_history_revision_id)