2 package Debbugs::DB::Result::BugStatusCache;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Debbugs::DB::Result::BugStatusCache - Bug Status Cache
16 use base 'DBIx::Class::Core';
18 =head1 COMPONENTS LOADED
22 =item * L<DBIx::Class::InflateColumn::DateTime>
24 =item * L<DBIx::Class::TimeStamp>
30 __PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp");
32 =head1 TABLE: C<bug_status_cache>
36 __PACKAGE__->table("bug_status_cache");
46 Bug number (matches bug)
54 Suite id (matches suite)
62 Architecture id (matches arch)
67 extra: {custom_type_name => "bug_status_type",list => ["absent","found","fixed","undef"]}
74 data_type: 'timestamp with time zone'
75 default_value: current_timestamp
77 original: {default_value => \"now()"}
79 Time that this status was last modified
83 data_type: 'timestamp with time zone'
84 default_value: current_timestamp
86 original: {default_value => \"now()"}
88 Time that this status was last calculated
92 __PACKAGE__->add_columns(
94 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
96 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
98 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
103 custom_type_name => "bug_status_type",
104 list => ["absent", "found", "fixed", "undef"],
110 data_type => "timestamp with time zone",
111 default_value => \"current_timestamp",
113 original => { default_value => \"now()" },
117 data_type => "timestamp with time zone",
118 default_value => \"current_timestamp",
120 original => { default_value => \"now()" },
124 =head1 UNIQUE CONSTRAINTS
126 =head2 C<bug_status_cache_bug_suite_arch_idx>
140 __PACKAGE__->add_unique_constraint(
141 "bug_status_cache_bug_suite_arch_idx",
142 ["bug", "suite", "arch"],
151 Related object: L<Debbugs::DB::Result::Arch>
155 __PACKAGE__->belongs_to(
157 "Debbugs::DB::Result::Arch",
162 on_delete => "CASCADE",
163 on_update => "CASCADE",
171 Related object: L<Debbugs::DB::Result::Bug>
175 __PACKAGE__->belongs_to(
177 "Debbugs::DB::Result::Bug",
179 { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
186 Related object: L<Debbugs::DB::Result::Suite>
190 __PACKAGE__->belongs_to(
192 "Debbugs::DB::Result::Suite",
197 on_delete => "CASCADE",
198 on_update => "CASCADE",
203 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-08-07 09:58:56
204 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RNAken/j2+82FVCyCTnvQw
206 sub sqlt_deploy_hook {
207 my ($self, $sqlt_table) = @_;
208 # $sqlt_table->add_index(name => 'bug_status_cache_bug_suite_arch_idx',
210 # q{COALESCE(suite,0)},
211 # q{COALESCE(arch,0)},]
213 for my $f (qw(bug status arch suite asof)) {
214 $sqlt_table->add_index(name => 'bug_status_cache_idx_'.$f,