]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/BugBinpackage.pm
d57299494a925efdbd25a5fe46be0a00c957fec1
[debbugs.git] / Debbugs / DB / Result / BugBinpackage.pm
1 use utf8;
2 package Debbugs::DB::Result::BugBinpackage;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Debbugs::DB::Result::BugBinpackage - Bug <-> binary package mapping
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 COMPONENTS LOADED
19
20 =over 4
21
22 =item * L<DBIx::Class::InflateColumn::DateTime>
23
24 =item * L<DBIx::Class::TimeStamp>
25
26 =back
27
28 =cut
29
30 __PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp");
31
32 =head1 TABLE: C<bug_binpackage>
33
34 =cut
35
36 __PACKAGE__->table("bug_binpackage");
37
38 =head1 ACCESSORS
39
40 =head2 bug
41
42   data_type: 'integer'
43   is_foreign_key: 1
44   is_nullable: 0
45
46 Bug id (matches bug)
47
48 =head2 bin_pkg
49
50   data_type: 'integer'
51   is_foreign_key: 1
52   is_nullable: 0
53
54 Binary package id (matches bin_pkg)
55
56 =cut
57
58 __PACKAGE__->add_columns(
59   "bug",
60   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
61   "bin_pkg",
62   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
63 );
64
65 =head1 UNIQUE CONSTRAINTS
66
67 =head2 C<bug_binpackage_id_pkg>
68
69 =over 4
70
71 =item * L</bug>
72
73 =item * L</bin_pkg>
74
75 =back
76
77 =cut
78
79 __PACKAGE__->add_unique_constraint("bug_binpackage_id_pkg", ["bug", "bin_pkg"]);
80
81 =head1 RELATIONS
82
83 =head2 bin_pkg
84
85 Type: belongs_to
86
87 Related object: L<Debbugs::DB::Result::BinPkg>
88
89 =cut
90
91 __PACKAGE__->belongs_to(
92   "bin_pkg",
93   "Debbugs::DB::Result::BinPkg",
94   { id => "bin_pkg" },
95   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
96 );
97
98 =head2 bug
99
100 Type: belongs_to
101
102 Related object: L<Debbugs::DB::Result::Bug>
103
104 =cut
105
106 __PACKAGE__->belongs_to(
107   "bug",
108   "Debbugs::DB::Result::Bug",
109   { id => "bug" },
110   { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
111 );
112
113
114 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
115 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wL+pwSCfWe/mMQOjziKSeg
116
117
118 sub sqlt_deploy_hook {
119     my ($self, $sqlt_table) = @_;
120     $sqlt_table->add_index(name => 'bug_binpackage_bin_pkg_idx',
121                            fields => [qw(bin_pkg)],
122                           );
123 }
124
125 1;