]> git.donarmstrong.com Git - debbugs.git/blob - lib/Debbugs/DB/ResultSet/BinAssociation.pm
Debbugs::DB::Util is now a component of Debbugs::DB
[debbugs.git] / lib / Debbugs / DB / ResultSet / BinAssociation.pm
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>.
5 use utf8;
6 package Debbugs::DB::ResultSet::BinAssociation;
7
8 =head1 NAME
9
10 Debbugs::DB::ResultSet::BinAssociation - Binary/Suite Associations
11
12 =head1 SYNOPSIS
13
14
15
16 =head1 DESCRIPTION
17
18
19
20 =cut
21
22 use strict;
23 use warnings;
24
25 use base 'DBIx::Class::ResultSet';
26
27 sub insert_suite_bin_ver_association {
28     my ($self,$suite_id,$bin_ver_id) = @_;
29     return $self->result_source->schema->
30         select_one(<<'SQL',$suite_id,$bin_ver_id);
31 INSERT INTO bin_associations (suite,bin)
32    VALUES (?,?) ON CONFLICT (suite,bin) DO
33     UPDATE SET modified = NOW()
34    RETURNING id;
35 SQL
36 }
37
38 1;
39
40 __END__