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.
17 Add type_id foreign key to the Chado project table
18 Based on this commit https://github.com/GMOD/Chado/commit/364ac74f88182bcff07efe5c47d549886645239b
19 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
23 Naama Menda<nm249@cornell.edu>
25 =head1 COPYRIGHT & LICENSE
27 Copyright 2010 Boyce Thompson Institute for Plant Research
29 This program is free software; you can redistribute it and/or modify
30 it under the same terms as Perl itself.
35 package AddProjectTypeId
;
38 extends
'CXGN::Metadata::Dbpatch';
41 has
'+description' => ( default => <<'' );
42 Add type_id foreign key to the project table as added to the Chado
1.4 release
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 $self->dbh->do(<<EOSQL);
62 ADD COLUMN type_id bigint REFERENCES cvterm (cvterm_id) ON DELETE SET NULL;
63 CREATE INDEX project_idx1 ON project USING btree (type_id);
64 COMMENT ON COLUMN project.type_id IS 'An optional cvterm_id that specifies what type of project this record is. Prior to 1.4, project type was set with an projectprop.';
68 print "You're done!\n";