10 mx-run AddOrganismComments [options] -H hostname -D dbname -u username [-F]
12 this is a subclass of L<CXGN::Metadata::Dbpatch>
13 see the perldoc of parent class for more details.
17 Removes unnecessary database constraint.
21 Lukas Mueller <lam87@cornell.edu>
23 =head1 COPYRIGHT & LICENSE
25 Copyright 2010 Boyce Thompson Institute for Plant Research
27 This program is free software; you can redistribute it and/or modify
28 it under the same terms as Perl itself.
33 package AddOrganismComments
;
36 extends
'CXGN::Metadata::Dbpatch';
39 has
'+description' => ( default => 'Removes unnecessary database constraint.' );
51 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
53 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
55 print STDOUT
"\nExecuting the SQL commands.\n";
57 $self->dbh->do(<<EOSQL);
61 ALTER TABLE sgn_people.forum_topic DROP CONSTRAINT chk_forum_topic_page_type;
68 print "You're done!\n";
77 # -- 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 OR page_type::text = 'organism');