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>
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 AddTreatmentCvterms
;
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";
68 'experiment_type' => [
69 'treatment_experiment',
71 'project_relationship' => [
72 'trial_treatment_relationship'
76 foreach my $t (keys %$terms){
77 foreach (@
{$terms->{$t}}){
78 $schema->resultset("Cv::Cvterm")->create_with({
86 print "You're done!\n";