Skip to content

Instantly share code, notes, and snippets.

@nmenda
Created January 25, 2010 18:37
Show Gist options
  • Save nmenda/286093 to your computer and use it in GitHub Desktop.
Save nmenda/286093 to your computer and use it in GitHub Desktop.
my $pub_cv= $schema->resultset('Cv::Cv')->find_or_create(
{ name = 'publication' } );
my ($journal_cvterm) = $schema->resultset('Cv::Cv')->find(
{ name => 'journal',
cv_id => $pub_cv->cv_id()
} ) ;
if (!$journal_cvterm) {
my $pub_db= $schema->resultset('General::Db')->find_or_create(
{ name = 'null' } );
my $pub_dbxref= $schema->resultset('General::Dbxref')->find_or_create(
{ name => 'null',
db_id => $pub_db->db_id(),
} );
$journal_cvterm = $schema->resultset('Cv::Cvterm')->create(
{ name => 'journal' ,
cv_id => $pub_cv->cv_id(),
dbxref_id => $pub_dbxref->dbxref_id()
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment