Merge pull request #5205 from solgenomics/topic/generic_trial_upload
[sgn.git] / db / 00141 / AddVcfType.pm
blobf9dfb7fb51f9c4ba40d44d9ab4ed3513c14ef00b
1 #!/usr/bin/env perl
4 =head1 NAME
6 AddVcfType.pm
8 =head1 SYNOPSIS
10 mx-run ThisPackageName [options] -H hostname -D dbname -u username [-F]
12 This patch add new cvterm vcf_snp_dbxref to nd_protocol
14 =head1 DESCRIPTION
16 This dbpatch adds vcf_snp_dbxref to nd_protocol and nd_protocolprop to provide external links to marker_names
19 =head1 AUTHOR
21 Clay Birkett<clb343@cornell.edu>
23 =head1 COPYRIGHT & LICENSE
25 Copyright 2010 Boyce Thompson Institute for Plant Research
27 This program is free software; you can redistribute it and/or modify
28 it under the same terms as Perl itself.
30 =cut
33 package AddVcfType;
35 use Moose;
36 use Bio::Chado::Schema;
37 use Try::Tiny;
38 extends 'CXGN::Metadata::Dbpatch';
40 has '+description' => ( default => <<'' );
41 This patch add new cvterm vcf_snp_dbxref to nd_protocol
43 has '+prereq' => (
44 default => sub {
45 [],
49 sub patch {
50 my $self=shift;
52 print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
54 print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
56 print STDOUT "\nExecuting the SQL commands.\n";
58 my $schema = Bio::Chado::Schema->connect( sub { $self->dbh->clone } );
60 my $term = 'vcf_snp_dbxref';
62 $schema->resultset("Cv::Cvterm")->create_with( {
63 name => $term,
64 cv => 'protocol_property', }
68 print "You're done!\n";
72 ####
73 1; #
74 ####