]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/SrcPkg.pm
fc6b2e1a24ce65af6a5bfffcb1922b9ae1e066b4
[debbugs.git] / Debbugs / DB / Result / SrcPkg.pm
1 use utf8;
2 package Debbugs::DB::Result::SrcPkg;
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::SrcPkg - Source packages
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<src_pkg>
33
34 =cut
35
36 __PACKAGE__->table("src_pkg");
37
38 =head1 ACCESSORS
39
40 =head2 id
41
42   data_type: 'integer'
43   is_auto_increment: 1
44   is_nullable: 0
45   sequence: 'src_pkg_id_seq'
46
47 Source package id
48
49 =head2 pkg
50
51   data_type: 'text'
52   is_nullable: 0
53
54 Source package name
55
56 =head2 pseduopkg
57
58   data_type: 'boolean'
59   default_value: false
60   is_nullable: 0
61
62 =head2 alias_of
63
64   data_type: 'integer'
65   is_foreign_key: 1
66   is_nullable: 1
67
68 Source package id which this source package is an alias of
69
70 =head2 creation
71
72   data_type: 'timestamp with time zone'
73   default_value: current_timestamp
74   is_nullable: 0
75   original: {default_value => \"now()"}
76
77 =head2 disabled
78
79   data_type: 'timestamp with time zone'
80   default_value: infinity
81   is_nullable: 0
82
83 =head2 last_modified
84
85   data_type: 'timestamp with time zone'
86   default_value: current_timestamp
87   is_nullable: 0
88   original: {default_value => \"now()"}
89
90 =head2 obsolete
91
92   data_type: 'boolean'
93   default_value: false
94   is_nullable: 0
95
96 =cut
97
98 __PACKAGE__->add_columns(
99   "id",
100   {
101     data_type         => "integer",
102     is_auto_increment => 1,
103     is_nullable       => 0,
104     sequence          => "src_pkg_id_seq",
105   },
106   "pkg",
107   { data_type => "text", is_nullable => 0 },
108   "pseduopkg",
109   { data_type => "boolean", default_value => \"false", is_nullable => 0 },
110   "alias_of",
111   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
112   "creation",
113   {
114     data_type     => "timestamp with time zone",
115     default_value => \"current_timestamp",
116     is_nullable   => 0,
117     original      => { default_value => \"now()" },
118   },
119   "disabled",
120   {
121     data_type     => "timestamp with time zone",
122     default_value => "infinity",
123     is_nullable   => 0,
124   },
125   "last_modified",
126   {
127     data_type     => "timestamp with time zone",
128     default_value => \"current_timestamp",
129     is_nullable   => 0,
130     original      => { default_value => \"now()" },
131   },
132   "obsolete",
133   { data_type => "boolean", default_value => \"false", is_nullable => 0 },
134 );
135
136 =head1 PRIMARY KEY
137
138 =over 4
139
140 =item * L</id>
141
142 =back
143
144 =cut
145
146 __PACKAGE__->set_primary_key("id");
147
148 =head1 UNIQUE CONSTRAINTS
149
150 =head2 C<src_pkg_pkg_disabled>
151
152 =over 4
153
154 =item * L</pkg>
155
156 =item * L</disabled>
157
158 =back
159
160 =cut
161
162 __PACKAGE__->add_unique_constraint("src_pkg_pkg_disabled", ["pkg", "disabled"]);
163
164 =head1 RELATIONS
165
166 =head2 alias_of
167
168 Type: belongs_to
169
170 Related object: L<Debbugs::DB::Result::SrcPkg>
171
172 =cut
173
174 __PACKAGE__->belongs_to(
175   "alias_of",
176   "Debbugs::DB::Result::SrcPkg",
177   { id => "alias_of" },
178   {
179     is_deferrable => 0,
180     join_type     => "LEFT",
181     on_delete     => "CASCADE",
182     on_update     => "CASCADE",
183   },
184 );
185
186 =head2 bug_affects_srcpackages
187
188 Type: has_many
189
190 Related object: L<Debbugs::DB::Result::BugAffectsSrcpackage>
191
192 =cut
193
194 __PACKAGE__->has_many(
195   "bug_affects_srcpackages",
196   "Debbugs::DB::Result::BugAffectsSrcpackage",
197   { "foreign.src_pkg" => "self.id" },
198   { cascade_copy => 0, cascade_delete => 0 },
199 );
200
201 =head2 bug_srcpackages
202
203 Type: has_many
204
205 Related object: L<Debbugs::DB::Result::BugSrcpackage>
206
207 =cut
208
209 __PACKAGE__->has_many(
210   "bug_srcpackages",
211   "Debbugs::DB::Result::BugSrcpackage",
212   { "foreign.src_pkg" => "self.id" },
213   { cascade_copy => 0, cascade_delete => 0 },
214 );
215
216 =head2 bug_vers
217
218 Type: has_many
219
220 Related object: L<Debbugs::DB::Result::BugVer>
221
222 =cut
223
224 __PACKAGE__->has_many(
225   "bug_vers",
226   "Debbugs::DB::Result::BugVer",
227   { "foreign.src_pkg" => "self.id" },
228   { cascade_copy => 0, cascade_delete => 0 },
229 );
230
231 =head2 src_pkgs
232
233 Type: has_many
234
235 Related object: L<Debbugs::DB::Result::SrcPkg>
236
237 =cut
238
239 __PACKAGE__->has_many(
240   "src_pkgs",
241   "Debbugs::DB::Result::SrcPkg",
242   { "foreign.alias_of" => "self.id" },
243   { cascade_copy => 0, cascade_delete => 0 },
244 );
245
246 =head2 src_vers
247
248 Type: has_many
249
250 Related object: L<Debbugs::DB::Result::SrcVer>
251
252 =cut
253
254 __PACKAGE__->has_many(
255   "src_vers",
256   "Debbugs::DB::Result::SrcVer",
257   { "foreign.src_pkg" => "self.id" },
258   { cascade_copy => 0, cascade_delete => 0 },
259 );
260
261
262 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
263 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j8LGu4eUfNUNxM/jkHUG2A
264
265
266 sub sqlt_deploy_hook {
267     my ($self, $sqlt_table) = @_;
268     $sqlt_table->add_index(name => 'src_pkg_pkg',
269                            fields => 'pkg',
270                           );
271 }
272 1;