]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/BugMessage.pm
b5fccc558984ef1c1f641dbbfdadaa0bccee1e8e
[debbugs.git] / Debbugs / DB / Result / BugMessage.pm
1 use utf8;
2 package Debbugs::DB::Result::BugMessage;
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::BugMessage
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_message>
33
34 =cut
35
36 __PACKAGE__->table("bug_message");
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 message
49
50   data_type: 'integer'
51   is_foreign_key: 1
52   is_nullable: 0
53
54 Message id (matches message)
55
56 =head2 message_number
57
58   data_type: 'integer'
59   is_nullable: 0
60
61 Message number in the bug log
62
63 =head2 bug_log_offset
64
65   data_type: 'integer'
66   is_nullable: 1
67
68 Byte offset in the bug log
69
70 =head2 offset_valid
71
72   data_type: 'timestamp with time zone'
73   is_nullable: 1
74
75 Time offset was valid
76
77 =cut
78
79 __PACKAGE__->add_columns(
80   "bug",
81   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
82   "message",
83   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
84   "message_number",
85   { data_type => "integer", is_nullable => 0 },
86   "bug_log_offset",
87   { data_type => "integer", is_nullable => 1 },
88   "offset_valid",
89   { data_type => "timestamp with time zone", is_nullable => 1 },
90 );
91
92 =head1 UNIQUE CONSTRAINTS
93
94 =head2 C<bug_message_bug_message_idx>
95
96 =over 4
97
98 =item * L</bug>
99
100 =item * L</message>
101
102 =back
103
104 =cut
105
106 __PACKAGE__->add_unique_constraint("bug_message_bug_message_idx", ["bug", "message"]);
107
108 =head1 RELATIONS
109
110 =head2 bug
111
112 Type: belongs_to
113
114 Related object: L<Debbugs::DB::Result::Bug>
115
116 =cut
117
118 __PACKAGE__->belongs_to(
119   "bug",
120   "Debbugs::DB::Result::Bug",
121   { id => "bug" },
122   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
123 );
124
125 =head2 message
126
127 Type: belongs_to
128
129 Related object: L<Debbugs::DB::Result::Message>
130
131 =cut
132
133 __PACKAGE__->belongs_to(
134   "message",
135   "Debbugs::DB::Result::Message",
136   { id => "message" },
137   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
138 );
139
140
141 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
142 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BRbN9C6P/wvWWmSmjNGjLA
143
144 sub sqlt_deploy_hook {
145     my ($self, $sqlt_table) = @_;
146     $sqlt_table->add_index(name => 'bug_message_idx_bug_message_number',
147                            fields => [qw(bug message_number)],
148                           );
149 }
150 1;