Merge pull request #5069 from solgenomics/topic/accession_upload_file
[sgn.git] / db / 00064 / AddNdprotocolDescriptionChado.pm
blob7d0f4399244e209d73c4d677e3d07fb235de218e
1 #!/usr/bin/env perl
4 =head1 NAME
6 AddNdprotocolDescriptionChado
8 =head1 SYNOPSIS
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.
15 =head1 DESCRIPTION
17 Add a description column to the Chado table nd_protocol
18 This change will go into Chado version 1.4. See GMOD git repo for details.
19 DO NOT ALTER CHADO TABLES WITHOUT COORDINATING WITH GMOD FIRST!
21 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
23 =head1 AUTHOR
25 Naama Menda<nm249@cornell.edu>
27 =head1 COPYRIGHT & LICENSE
29 Copyright 2010 Boyce Thompson Institute for Plant Research
31 This program is free software; you can redistribute it and/or modify
32 it under the same terms as Perl itself.
34 =cut
37 package AddNdprotocolDescriptionChado;
39 use Moose;
40 extends 'CXGN::Metadata::Dbpatch';
43 has '+description' => ( default => <<'' );
44 patch for adding descriotion column to chado table nd_protocol. This change will go into Chado version 1.4. DO NOT ALTER CHADO TABLES WITHOUT COORDINATING FIRST WITH GMOD!
47 sub patch {
48 my $self=shift;
50 print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
52 print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
54 print STDOUT "\nExecuting the SQL commands.\n";
56 $self->dbh->do(<<EOSQL);
57 --do your SQL here
60 ALTER TABLE nd_protocol ADD COLUMN description varchar(255) DEFAULT null;
63 EOSQL
65 print "You're done!\n";
69 ####
70 1; #
71 ####