File Coverage

blib/lib/Tapper/Schema/TestrunDB/Result/ChartTagRelations.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Tapper::Schema::TestrunDB::Result::ChartTagRelations;
2             our $AUTHORITY = 'cpan:TAPPER';
3             $Tapper::Schema::TestrunDB::Result::ChartTagRelations::VERSION = '5.0.11';
4             # ABSTRACT: Tapper - Keep relations between charts and chart tags
5              
6 7     7   3875 use strict;
  7         16  
  7         182  
7 7     7   31 use warnings;
  7         14  
  7         222  
8              
9 7     7   33 use parent 'DBIx::Class';
  7         14  
  7         193  
10              
11             __PACKAGE__->load_components(qw/FilterColumn InflateColumn::DateTime Core/);
12             __PACKAGE__->table('chart_tag_relations');
13             __PACKAGE__->add_columns(
14             'chart_id', {
15             data_type => 'INT',
16             default_value => undef,
17             is_nullable => 0,
18             size => 11,
19             is_foreign_key => 1,
20             extra => {
21             unsigned => 1,
22             },
23             },
24             'chart_tag_id', {
25             data_type => 'SMALLINT',
26             default_value => undef,
27             is_nullable => 0,
28             size => 6,
29             is_foreign_key => 1,
30             extra => {
31             unsigned => 1,
32             },
33             },
34             'created_at', {
35             data_type => 'TIMESTAMP',
36             default_value => undef,
37             is_nullable => 0,
38             set_on_create => 1,
39             },
40             );
41              
42              
43             (my $basepkg = __PACKAGE__) =~ s/::\w+$//;
44              
45             __PACKAGE__->set_primary_key('chart_id','chart_tag_id');
46              
47             __PACKAGE__->belongs_to(
48             chart => "${basepkg}::Charts",
49             { 'foreign.chart_id' => 'self.chart_id' },
50             );
51             __PACKAGE__->belongs_to(
52             chart_tag => "${basepkg}::ChartTags",
53             { 'foreign.chart_tag_id' => 'self.chart_tag_id' },
54             );
55              
56             1;
57              
58             __END__
59              
60             =pod
61              
62             =encoding UTF-8
63              
64             =head1 NAME
65              
66             Tapper::Schema::TestrunDB::Result::ChartTagRelations - Tapper - Keep relations between charts and chart tags
67              
68             =head1 AUTHORS
69              
70             =over 4
71              
72             =item *
73              
74             AMD OSRC Tapper Team <tapper@amd64.org>
75              
76             =item *
77              
78             Tapper Team <tapper-ops@amazon.com>
79              
80             =back
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is Copyright (c) 2019 by Advanced Micro Devices, Inc..
85              
86             This is free software, licensed under:
87              
88             The (two-clause) FreeBSD License
89              
90             =cut