6 AddMdImageCvtermTable.pm
10 mx-run ThisPackageName [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 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
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 AddMdImageCvtermTable
;
36 extends
'CXGN::Metadata::Dbpatch';
39 has
'+description' => ( default => <<'' );
40 Adds a linking table between the metadata
.md_image
and cvterm table
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 CREATE TABLE metadata.md_image_cvterm (
62 md_image_cvterm_id serial primary key,
63 image_id bigint REFERENCES metadata.md_image(image_id) NOT NULL,
64 cvterm_id bigint REFERENCES cvterm(cvterm_id) NOT NULL,
65 sp_person_id bigint REFERENCES sgn_people.sp_person(sp_person_id),
66 obsolete boolean DEFAULT false
70 GRANT select,insert ON metadata.md_image_cvterm TO web_usr;
71 GRANT USAGE ON metadata.md_image_cvterm_md_image_cvterm_id_seq to web_usr;
75 print "You're done!\n";