]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/BinVer.pm
use CGI::Simple->new()
[debbugs.git] / Debbugs / DB / Result / BinVer.pm
1 use utf8;
2 package Debbugs::DB::Result::BinVer;
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::BinVer - Binary 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<bin_ver>
33
34 =cut
35
36 __PACKAGE__->table("bin_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: 'bin_ver_id_seq'
46
47 Binary version id
48
49 =head2 bin_pkg
50
51   data_type: 'integer'
52   is_foreign_key: 1
53   is_nullable: 0
54
55 Binary package id (matches bin_pkg)
56
57 =head2 src_ver
58
59   data_type: 'integer'
60   is_foreign_key: 1
61   is_nullable: 0
62
63 Source version (matchines src_ver)
64
65 =head2 arch
66
67   data_type: 'integer'
68   is_foreign_key: 1
69   is_nullable: 0
70
71 Architecture id (matches arch)
72
73 =head2 ver
74
75   data_type: 'debversion'
76   is_nullable: 0
77
78 Binary version
79
80 =cut
81
82 __PACKAGE__->add_columns(
83   "id",
84   {
85     data_type         => "integer",
86     is_auto_increment => 1,
87     is_nullable       => 0,
88     sequence          => "bin_ver_id_seq",
89   },
90   "bin_pkg",
91   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
92   "src_ver",
93   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
94   "arch",
95   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
96   "ver",
97   { data_type => "debversion", is_nullable => 0 },
98 );
99
100 =head1 PRIMARY KEY
101
102 =over 4
103
104 =item * L</id>
105
106 =back
107
108 =cut
109
110 __PACKAGE__->set_primary_key("id");
111
112 =head1 UNIQUE CONSTRAINTS
113
114 =head2 C<bin_ver_bin_pkg_id_arch_idx>
115
116 =over 4
117
118 =item * L</bin_pkg>
119
120 =item * L</arch>
121
122 =item * L</ver>
123
124 =back
125
126 =cut
127
128 __PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg", "arch", "ver"]);
129
130 =head1 RELATIONS
131
132 =head2 arch
133
134 Type: belongs_to
135
136 Related object: L<Debbugs::DB::Result::Arch>
137
138 =cut
139
140 __PACKAGE__->belongs_to(
141   "arch",
142   "Debbugs::DB::Result::Arch",
143   { id => "arch" },
144   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
145 );
146
147 =head2 bin_associations
148
149 Type: has_many
150
151 Related object: L<Debbugs::DB::Result::BinAssociation>
152
153 =cut
154
155 __PACKAGE__->has_many(
156   "bin_associations",
157   "Debbugs::DB::Result::BinAssociation",
158   { "foreign.bin" => "self.id" },
159   { cascade_copy => 0, cascade_delete => 0 },
160 );
161
162 =head2 bin_pkg
163
164 Type: belongs_to
165
166 Related object: L<Debbugs::DB::Result::BinPkg>
167
168 =cut
169
170 __PACKAGE__->belongs_to(
171   "bin_pkg",
172   "Debbugs::DB::Result::BinPkg",
173   { id => "bin_pkg" },
174   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
175 );
176
177 =head2 src_ver
178
179 Type: belongs_to
180
181 Related object: L<Debbugs::DB::Result::SrcVer>
182
183 =cut
184
185 __PACKAGE__->belongs_to(
186   "src_ver",
187   "Debbugs::DB::Result::SrcVer",
188   { id => "src_ver" },
189   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
190 );
191
192
193 # Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-11-24 09:08:27
194 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DzTzZbPkilT8WMhXoZv9xw
195
196
197 sub sqlt_deploy_hook {
198     my ($self, $sqlt_table) = @_;
199     for my $idx (qw(ver bin_pkg src_ver)) {
200         $sqlt_table->add_index(name => 'bin_ver_'.$idx.'_id_idx',
201                                fields => [$idx]);
202     }
203     $sqlt_table->add_index(name => 'bin_ver_src_ver_id_arch_idx',
204                            fields => [qw(src_ver arch)]
205                           );
206 }
207
208 1;