1 package AddLocusTableIndexes
;
5 extends
'CXGN::Metadata::Dbpatch';
9 my $name = __PACKAGE__
;
10 print "dbpatch name is : '" . $name . "'\n\n";
11 my $description = 'Add missing locus_id indexes to phenome schema.';
12 my @previous_requested_patches = (); #ADD HERE
15 $self->description($description);
16 $self->prereq(\
@previous_requested_patches);
23 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
25 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
27 print STDOUT
"\nExecuting the SQL commands.\n";
29 $self->dbh->do(<<EOSQL);
30 create index locus_history_locus_id on phenome.locus_history(locus_id);
31 create index locus_pub_ranking_locus_id on phenome.locus_pub_ranking(locus_id);
32 create index allele_locus_id on phenome.allele(locus_id);
33 create index locus_alias_locus_id on phenome.locus_alias(locus_id);
36 create index locus2locus_subject_id on phenome.locus2locus(subject_id);
37 create index locus2locus_object_id on phenome.locus2locus(object_id);
39 create index individual_locus_locus_id on phenome.individual_locus(locus_id);
40 create index locus_image_locus_id on phenome.locus_image(locus_id);
43 print "You're done!\n";