X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResultSet%2FBinVer.pm;fp=Debbugs%2FDB%2FResultSet%2FBinVer.pm;h=0000000000000000000000000000000000000000;hb=1e6633a3780f4fd53fc4303852e84d13cdad2dc6;hp=fcd8b59d7f43a696b1fef6271cbb3f984f1a02ba;hpb=466f7faff129a5699c7674f59900a92aa256175d;p=debbugs.git diff --git a/Debbugs/DB/ResultSet/BinVer.pm b/Debbugs/DB/ResultSet/BinVer.pm deleted file mode 100644 index fcd8b59..0000000 --- a/Debbugs/DB/ResultSet/BinVer.pm +++ /dev/null @@ -1,56 +0,0 @@ -# This module is part of debbugs, and is released -# under the terms of the GPL version 2, or any later version. See the -# file README and COPYING for more information. -# Copyright 2017 by Don Armstrong . -use utf8; -package Debbugs::DB::ResultSet::BinVer; - -=head1 NAME - -Debbugs::DB::ResultSet::BinVer - Source Version association - -=head1 SYNOPSIS - - - -=head1 DESCRIPTION - - - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::ResultSet'; - -use Debbugs::DB::Util qw(select_one); - - -sub get_bin_ver_id { - my ($self,$bin_pkg_id,$bin_ver,$arch_id,$src_ver_id) = @_; - return $self->result_source->schema->storage-> - dbh_do(sub { - my ($s,$dbh,$bp_id,$bv,$a_id,$sv_id) = @_; - return select_one($dbh,<<'SQL', -WITH ins AS ( -INSERT INTO bin_ver (bin_pkg,src_ver,arch,ver) -VALUES (?,?,?,?) ON CONFLICT (bin_pkg,arch,ver) DO NOTHING RETURNING id -) -SELECT id FROM ins -UNION ALL -SELECT id FROM bin_ver WHERE bin_pkg = ? AND arch = ? AND ver = ? -LIMIT 1; -SQL - $bp_id,$sv_id, - $a_id,$bv, - $bp_id,$a_id, - $bv); - }, - $bin_pkg_id,$bin_ver,$arch_id,$src_ver_id - ); -} - -1; - -__END__