Added additional index to consent table as well as foreign_key index.

This commit is contained in:
Shawn Kwang 2018-09-12 11:32:40 -05:00
parent 60ee7e85f9
commit c4c2ae69ba
2 changed files with 14 additions and 1 deletions

View File

@ -182,6 +182,12 @@ alter table sent_email
alter table consent
add index userid_ctid(userid, consent_type_id);
add index consent_timestamp(consent_time);
add index flag_ctid(consent_flag, consent_type_id);
alter table consent
add foreign key(consent_type_id)
references consent_type(id)
on update cascade;
alter table consent_type
add index consent_name(shortname);

View File

@ -1173,7 +1173,8 @@ function update_5_17_2018() {
source varchar(255) not null,
primary key (id),
index userid_ctid(userid, consent_type_id),
index consent_timestamp(consent_time)
index consent_timestamp(consent_time),
index flag_ctid(consent_flag, consent_type_id)
) engine=InnoDB;
");
@ -1189,6 +1190,12 @@ function update_5_17_2018() {
) engine=InnoDB;
");
do_query("alter table consent
add foreign key(consent_type_id)
references consent_type(id)
on update cascade;
");
do_query("insert into consent_type
(id, shortname, description, enabled, protect, privacypref) values
(1, 'ENROLL', 'General terms-of-use for this BOINC project.', 0, 1, 0);