9 mx-run AddNewCrossCvterms [options] -H hostname -D dbname -u username [-F]
11 this is a subclass of L<CXGN::Metadata::Dbpatch>
12 see the perldoc of parent class for more details.
16 This patch adds new cross cvterms so that they can be stored in the nd_experimentprop table.
20 Bryan Ellerbrock<bje24@cornell.edu>
22 =head1 COPYRIGHT & LICENSE
24 Copyright 2010 Boyce Thompson Institute for Plant Research
26 This program is free software; you can redistribute it and/or modify
27 it under the same terms as Perl itself.
32 package AddNewCrossCvterms
;
35 use Bio
::Chado
::Schema
;
37 extends
'CXGN::Metadata::Dbpatch';
40 has
'+description' => ( default => <<'' );
41 This patch adds new cross cvterms so that they can be stored
in the nd_experimentprop table
.
47 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
49 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
51 print STDOUT
"\nExecuting the SQL commands.\n";
53 my $schema = Bio
::Chado
::Schema
->connect( sub { $self->dbh->clone } );
57 my $date_of_pollination = $schema->resultset("Cv::Cvterm")->create_with({
58 name
=> 'date_of_pollination',
59 cv
=> 'nd_experiment_property',
62 my $date_of_harvest = $schema->resultset("Cv::Cvterm")->create_with({
63 name
=> 'date_of_harvest',
64 cv
=> 'nd_experiment_property',
67 my $date_of_seed_extraction = $schema->resultset("Cv::Cvterm")->create_with({
68 name
=> 'date_of_seed_extraction',
69 cv
=> 'nd_experiment_property',
72 my $number_of_seeds_extracted = $schema->resultset("Cv::Cvterm")->create_with({
73 name
=> 'number_of_seeds_extracted',
74 cv
=> 'nd_experiment_property',
77 my $number_of_viable_seeds = $schema->resultset("Cv::Cvterm")->create_with({
78 name
=> 'number_of_viable_seeds',
79 cv
=> 'nd_experiment_property',
82 my $number_of_nonviable_seeds = $schema->resultset("Cv::Cvterm")->create_with({
83 name
=> 'number_of_nonviable_seeds',
84 cv
=> 'nd_experiment_property',
87 my $date_of_embryo_rescue = $schema->resultset("Cv::Cvterm")->create_with({
88 name
=> 'date_of_embryo_rescue',
89 cv
=> 'nd_experiment_property',
92 my $number_of_embryos_rescued = $schema->resultset("Cv::Cvterm")->create_with({
93 name
=> 'number_of_embryos_rescued',
94 cv
=> 'nd_experiment_property',
97 my $number_of_embryos_germinated = $schema->resultset("Cv::Cvterm")->create_with({
98 name
=> 'number_of_embryos_germinated',
99 cv
=> 'nd_experiment_property',
102 my $number_of_embryos_contaminated = $schema->resultset("Cv::Cvterm")->create_with({
103 name
=> 'number_of_embryos_contaminated',
104 cv
=> 'nd_experiment_property',
107 my $number_of_seeds_planted = $schema->resultset("Cv::Cvterm")->create_with({
108 name
=> 'number_of_seeds_planted',
109 cv
=> 'nd_experiment_property',
112 my $number_of_seeds_germinated = $schema->resultset("Cv::Cvterm")->create_with({
113 name
=> 'number_of_seeds_germinated',
114 cv
=> 'nd_experiment_property',
117 my $days_to_maturity = $schema->resultset("Cv::Cvterm")->create_with({
118 name
=> 'days_to_maturity',
119 cv
=> 'nd_experiment_property',
122 my $days_from_harvest_to_extraction = $schema->resultset("Cv::Cvterm")->create_with({
123 name
=> 'days_from_harvest_to_extraction',
124 cv
=> 'nd_experiment_property',
127 my $days_from_extraction_to_embryo_rescue = $schema->resultset("Cv::Cvterm")->create_with({
128 name
=> 'days_from_extraction_to_embryo_rescue',
129 cv
=> 'nd_experiment_property',
132 my $number_of_progeny = $schema->resultset("Cv::Cvterm")->create_with({
133 name
=> 'number_of_progeny',
134 cv
=> 'nd_experiment_property',
140 $schema->txn_do($coderef);
142 die "Load failed! " . $_ . "\n" ;
145 print "You're done!\n";