1 package AddForumPageTypes
;
4 extends
'CXGN::Metadata::Dbpatch';
9 my $name = __PACKAGE__
;
10 print "dbpatch name is ':" . $name . "\n\n";
11 my $description = 'Adding needed page types to sgn.forum_topic';
12 my @previous_requested_patches = (); #ADD HERE
14 $self->description($description);
15 $self->prereq(\
@previous_requested_patches);
21 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
23 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
25 print STDOUT
"\nExecuting the SQL commands.\n";
27 $self->dbh->do( <<EOF );
28 ALTER TABLE sgn_people.forum_topic DROP CONSTRAINT chk_forum_topic_page_type;
29 ALTER TABLE sgn_people.forum_topic ADD CONSTRAINT chk_forum_topic_page_type CHECK (page_type::text = 'BAC'::text OR page_type::text = 'EST'::text OR page_type::text = 'unigene'::text OR page_type::text = 'marker'::text OR page_type::text = 'map'::text OR page_type::text = 'bac_end'::text OR page_type::text = ''::text OR page_type IS NULL OR page_type::text = 'locus'::text OR page_type::text = 'individual'::text OR page_type::text = 'pub'::text OR page_type::text = 'allele'::text OR page_type::text = 'stock'::text OR page_type::text = 'sample'::text) ;
33 print "You're done!\n";