Skip to content
Snippets Groups Projects
Commit 70415afd authored by Magali Ruffier's avatar Magali Ruffier
Browse files

adding the right values in the right order

parent 1bcf822c
No related branches found
No related tags found
No related merge requests found
......@@ -78,13 +78,13 @@ sub _write_aliases {
my ($self, $aliases, $species) = @_;
my $dbc = $self->_production_dbc();
$dbc->sql_helper()->transaction(sub {
my $sql = 'insert into species_alias (species_id, alias, is_current, created_at) values (?,?,?, NOW())';
my $sql = 'insert into species_alias (species_id, alias, is_current, created_at) values (?,?,1, NOW())';
my $id = $species->{id};
$dbc->sql_helper()->batch(-SQL => $sql, -CALLBACK => sub {
my ($sth) = @_;
foreach my $a (@{$aliases}) {
if($self->{opts}->{write}) {
$sth->execute($a, $id);
$sth->execute($id, $a);
}
else {
$self->v('Would have inserted the alias %s for species_id %d', $a, $id);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment