1 # This module is part of debbugs, and is released
2 # under the terms of the GPL version 2, or any later version. See the
3 # file README and COPYING for more information.
4 # Copyright 2017 by Don Armstrong <don@donarmstrong.com>.
6 package Debbugs::DB::ResultSet::BinVer;
10 Debbugs::DB::ResultSet::BinVer - Source Version association
25 use base 'DBIx::Class::ResultSet';
27 use Debbugs::DB::Util qw(select_one);
31 my ($self,$bin_pkg_id,$bin_ver,$arch_id,$src_ver_id) = @_;
32 return $self->result_source->schema->storage->
34 my ($s,$dbh,$bp_id,$bv,$a_id,$sv_id) = @_;
35 return select_one($dbh,<<'SQL',
37 INSERT INTO bin_ver (bin_pkg,src_ver,arch,ver)
38 VALUES (?,?,?,?) ON CONFLICT (bin_pkg,arch,ver) DO NOTHING RETURNING id
42 SELECT id FROM bin_ver WHERE bin_pkg = ? AND arch = ? AND ver = ?
50 $bin_pkg_id,$bin_ver,$arch_id,$src_ver_id