Merge pull request #1890 from solgenomics/topic/UpdateBrapiSearchDBlist
[sgn.git] / db / 00003 / AddFeatureIndex.pm
blobf09a3d62813e60594a89dc247bea998d7cae3aa4
1 package AddFeatureIndex;
3 use Try::Tiny;
4 use Moose;
5 use 5.010;
6 extends 'CXGN::Metadata::Dbpatch';
8 sub init_patch {
9 my $self=shift;
10 my $name = __PACKAGE__;
11 say "dbpatch name $name";
12 my $description = 'Add missing indexes';
13 my @previous_requested_patches = ();
14 $self->name($name);
15 $self->description($description);
16 $self->prereq(\@previous_requested_patches);
19 sub patch {
20 my $self=shift;
21 say "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
22 say "Checking if this db_patch was executed before or if previous db_patches have been executed.\n";
23 say "Executing the SQL commands.\n";
25 my $sql = <<SQL;
26 create index feature_idx6 on feature (lower(uniquename));
27 SQL
29 $self->dbh->do($sql);
30 say "Have a nice day!";