]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/BugVer.pm
472a1dffc31eb73a902605a802696e866a873ae9
[debbugs.git] / Debbugs / DB / Result / BugVer.pm
1 use utf8;
2 package Debbugs::DB::Result::BugVer;
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::BugVer - Bug versions
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_ver>
33
34 =cut
35
36 __PACKAGE__->table("bug_ver");
37
38 =head1 ACCESSORS
39
40 =head2 id
41
42   data_type: 'integer'
43   is_auto_increment: 1
44   is_nullable: 0
45   sequence: 'bug_ver_id_seq'
46
47 Bug version id
48
49 =head2 bug
50
51   data_type: 'integer'
52   is_foreign_key: 1
53   is_nullable: 0
54
55 Bug number
56
57 =head2 ver_string
58
59   data_type: 'text'
60   is_nullable: 1
61
62 Version string
63
64 =head2 src_pkg
65
66   data_type: 'integer'
67   is_foreign_key: 1
68   is_nullable: 1
69
70 Source package id (matches src_pkg table)
71
72 =head2 src_ver
73
74   data_type: 'integer'
75   is_foreign_key: 1
76   is_nullable: 1
77
78 Source package version id (matches src_ver table)
79
80 =head2 found
81
82   data_type: 'boolean'
83   default_value: true
84   is_nullable: 0
85
86 True if this is a found version; false if this is a fixed version
87
88 =head2 creation
89
90   data_type: 'timestamp with time zone'
91   default_value: current_timestamp
92   is_nullable: 0
93   original: {default_value => \"now()"}
94
95 Time that this entry was created
96
97 =head2 last_modified
98
99   data_type: 'timestamp with time zone'
100   default_value: current_timestamp
101   is_nullable: 0
102   original: {default_value => \"now()"}
103
104 Time that this entry was modified
105
106 =cut
107
108 __PACKAGE__->add_columns(
109   "id",
110   {
111     data_type         => "integer",
112     is_auto_increment => 1,
113     is_nullable       => 0,
114     sequence          => "bug_ver_id_seq",
115   },
116   "bug",
117   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
118   "ver_string",
119   { data_type => "text", is_nullable => 1 },
120   "src_pkg",
121   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
122   "src_ver",
123   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
124   "found",
125   { data_type => "boolean", default_value => \"true", is_nullable => 0 },
126   "creation",
127   {
128     data_type     => "timestamp with time zone",
129     default_value => \"current_timestamp",
130     is_nullable   => 0,
131     original      => { default_value => \"now()" },
132   },
133   "last_modified",
134   {
135     data_type     => "timestamp with time zone",
136     default_value => \"current_timestamp",
137     is_nullable   => 0,
138     original      => { default_value => \"now()" },
139   },
140 );
141
142 =head1 PRIMARY KEY
143
144 =over 4
145
146 =item * L</id>
147
148 =back
149
150 =cut
151
152 __PACKAGE__->set_primary_key("id");
153
154 =head1 UNIQUE CONSTRAINTS
155
156 =head2 C<bug_ver_bug_ver_string_found_idx>
157
158 =over 4
159
160 =item * L</bug>
161
162 =item * L</ver_string>
163
164 =item * L</found>
165
166 =back
167
168 =cut
169
170 __PACKAGE__->add_unique_constraint(
171   "bug_ver_bug_ver_string_found_idx",
172   ["bug", "ver_string", "found"],
173 );
174
175 =head1 RELATIONS
176
177 =head2 bug
178
179 Type: belongs_to
180
181 Related object: L<Debbugs::DB::Result::Bug>
182
183 =cut
184
185 __PACKAGE__->belongs_to(
186   "bug",
187   "Debbugs::DB::Result::Bug",
188   { id => "bug" },
189   { is_deferrable => 0, on_delete => "RESTRICT", on_update => "CASCADE" },
190 );
191
192 =head2 src_pkg
193
194 Type: belongs_to
195
196 Related object: L<Debbugs::DB::Result::SrcPkg>
197
198 =cut
199
200 __PACKAGE__->belongs_to(
201   "src_pkg",
202   "Debbugs::DB::Result::SrcPkg",
203   { id => "src_pkg" },
204   {
205     is_deferrable => 0,
206     join_type     => "LEFT",
207     on_delete     => "SET NULL",
208     on_update     => "CASCADE",
209   },
210 );
211
212 =head2 src_ver
213
214 Type: belongs_to
215
216 Related object: L<Debbugs::DB::Result::SrcVer>
217
218 =cut
219
220 __PACKAGE__->belongs_to(
221   "src_ver",
222   "Debbugs::DB::Result::SrcVer",
223   { id => "src_ver" },
224   {
225     is_deferrable => 0,
226     join_type     => "LEFT",
227     on_delete     => "SET NULL",
228     on_update     => "CASCADE",
229   },
230 );
231
232
233 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
234 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cvdjFL2o+rBg2PfcintuNA
235
236
237 sub sqlt_deploy_hook {
238     my ($self, $sqlt_table) = @_;
239     for my $idx (qw(src_pkg src_ver)) {
240         $sqlt_table->add_index(name => 'bug_ver_'.$idx.'_id_idx',
241                                fields => [$idx]);
242     }
243     $sqlt_table->add_index(name => 'bug_ver_src_pkg_id_src_ver_id_idx',
244                            fields => [qw(src_pkg src_ver)],
245                           );
246 }
247 1;