]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/BugBinpackage.pm
add bin_pkg to src_pkg convenience linking table with triggers
[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_bin_pkg_bug_idx>
68
69 =over 4
70
71 =item * L</bin_pkg>
72
73 =item * L</bug>
74
75 =back
76
77 =cut
78
79 __PACKAGE__->add_unique_constraint("bug_binpackage_bin_pkg_bug_idx", ["bin_pkg", "bug"]);
80
81 =head2 C<bug_binpackage_id_pkg>
82
83 =over 4
84
85 =item * L</bug>
86
87 =item * L</bin_pkg>
88
89 =back
90
91 =cut
92
93 __PACKAGE__->add_unique_constraint("bug_binpackage_id_pkg", ["bug", "bin_pkg"]);
94
95 =head1 RELATIONS
96
97 =head2 bin_pkg
98
99 Type: belongs_to
100
101 Related object: L<Debbugs::DB::Result::BinPkg>
102
103 =cut
104
105 __PACKAGE__->belongs_to(
106   "bin_pkg",
107   "Debbugs::DB::Result::BinPkg",
108   { id => "bin_pkg" },
109   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
110 );
111
112 =head2 bug
113
114 Type: belongs_to
115
116 Related object: L<Debbugs::DB::Result::Bug>
117
118 =cut
119
120 __PACKAGE__->belongs_to(
121   "bug",
122   "Debbugs::DB::Result::Bug",
123   { id => "bug" },
124   { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
125 );
126
127
128 # Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-04-20 10:29:04
129 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PJ2U+jVEO2uKfwgCYtho1A
130
131
132 sub sqlt_deploy_hook {
133     my ($self, $sqlt_table) = @_;
134     $sqlt_table->add_index(name => 'bug_binpackage_bin_pkg_idx',
135                            fields => [qw(bin_pkg)],
136                           );
137 }
138
139 1;