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.
16 This patch adds the necessary cvterms that are used for storing grafted stocks,
17 rootstock-scion stock_relationship, grafting_experiment ,and missing project types
20 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
24 Naama Menda<nm249@cornell.edu>
26 =head1 COPYRIGHT & LICENSE
28 Copyright 2010 Boyce Thompson Institute for Plant Research
30 This program is free software; you can redistribute it and/or modify
31 it under the same terms as Perl itself.
36 package AddGraftingCvterms
;
39 use Bio
::Chado
::Schema
;
41 extends
'CXGN::Metadata::Dbpatch';
44 has
'+description' => ( default => <<'' );
45 Add missing cvterms
for storing grafted stocks
, and grafting experiments
or projects
57 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
59 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
61 print STDOUT
"\nExecuting the SQL commands.\n";
62 my $schema = Bio
::Chado
::Schema
->connect( sub { $self->dbh->clone } );
65 print STDERR
"INSERTING CVTERMS...\n";
71 'stock_relationship' => [
75 'experiment_type' => [
76 'grafting_experiment',
85 foreach my $t (keys %$terms){
86 foreach (@
{$terms->{$t}}){
87 $schema->resultset("Cv::Cvterm")->create_with({
95 print "You're done!\n";