6 mx-run AddNewFolderCvterms [options] -H hostname -D dbname -u username [-F]
7 this is a subclass of L<CXGN::Metadata::Dbpatch>
8 see the perldoc of parent class for more details.
10 This patch adds new project_property cvterms for classifying folders
12 Nicolas Morales <nm529@cornell.edu>
13 =head1 COPYRIGHT & LICENSE
14 Copyright 2010 Boyce Thompson Institute for Plant Research
15 This program is free software; you can redistribute it and/or modify
16 it under the same terms as Perl itself.
20 package AddNewFolderCvterms
;
23 use Bio
::Chado
::Schema
;
25 extends
'CXGN::Metadata::Dbpatch';
28 has
'+description' => ( default => <<'' );
29 This patch adds new cross cvterms so that they can be stored
in the nd_experimentprop table
.
34 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
36 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
38 print STDOUT
"\nExecuting the SQL commands.\n";
40 my $schema = Bio
::Chado
::Schema
->connect( sub { $self->dbh->clone } );
44 my $folder_for_trials = $schema->resultset("Cv::Cvterm")->create_with({
45 name
=> 'folder_for_trials',
46 cv
=> 'project_property',
49 my $folder_for_crosses = $schema->resultset("Cv::Cvterm")->create_with({
50 name
=> 'folder_for_crosses',
51 cv
=> 'project_property',
57 $schema->txn_do($coderef);
59 die "Load failed! " . $_ . "\n" ;
62 print "You're done!\n";