Merge branch 'master' into topic/row_column_designs
[sgn.git] / db / 00144 / FixFieldbookImageCvterm.pm
blobe041ebec4960243208d9e2dc354ee7284cf47054
1 #!/usr/bin/env perl
4 =head1 NAME
6 FixFieldbookImageCvterm
8 =head1 SYNOPSIS
10 mx-run FixFieldbookImageCvterm [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.
15 =head1 DESCRIPTION
16 This patch fixes the fieldbook_image cvterm from showing up in the trait search as an ontology. This term was missing the upper link to its ontology.
18 Since this cvterm needs to be linked to an internal ontology instead of a crop ontology it is now removed from the database
20 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
22 =head1 AUTHOR
24 =head1 COPYRIGHT & LICENSE
26 Copyright 2010 Boyce Thompson Institute for Plant Research
28 This program is free software; you can redistribute it and/or modify
29 it under the same terms as Perl itself.
31 =cut
34 package FixFieldbookImageCvterm;
36 use Moose;
37 use Bio::Chado::Schema;
38 use Try::Tiny;
39 use SGN::Model::Cvterm;
40 extends 'CXGN::Metadata::Dbpatch';
43 has '+description' => ( default => <<'' );
44 This patch used to fix the fieldbook_image cvterm from showing up in the trait search as an ontology. This term was missing the upper link to its ontology.
45 Now it does nothing because it should not be linked to a crop ontology cv. A future patch will remove it from databases that ran the old version of this patch
46 has '+prereq' => (
47 default => sub {
48 [],
52 sub patch {
53 my $self=shift;
55 print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
57 print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
59 print STDOUT "\nExecuting the SQL commands.\n";
60 my $schema = Bio::Chado::Schema->connect( sub { $self->dbh->clone } );
62 print STDERR "Doing nothing ...\n";
65 print "You're done!\n";
69 ####
70 1; #
71 ####