7 mx-run ImageAddMD5sum [options] -H hostname -D dbname -u username [-F]
9 this is a subclass of L<CXGN::Metadata::Dbpatch>
10 see the perldoc of parent class for more details.
14 Adds a md5sum field to the metadata.md_image table.
16 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
20 Lukas Mueller <lam87@cornell.edu>
21 Naama Menda<nm249@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 ImageAddMD5sum
;
36 extends
'CXGN::Metadata::Dbpatch';
41 my $name = __PACKAGE__
;
42 print "dbpatch name is ':" . $name . "\n\n";
43 my $description = 'Testing a Moose dbpatch';
44 my @previous_requested_patches = (); #ADD HERE
47 $self->description("Adds a md5sum field to the metadata.md_image table");
48 $self->prereq(\
@previous_requested_patches);
56 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
58 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
62 print STDOUT
"\nExecuting the SQL commands.\n";
64 $self->dbh->do(<<EOSQL);
68 GRANT SELECT, UPDATE, INSERT, DELETE ON metadata.md_image TO web_usr;
70 ALTER TABLE metadata.md_image ADD COLUMN md5sum text
75 print "You're done!\n";