]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/MessageCorrespondent.pm
switch to compatibility level 12
[debbugs.git] / Debbugs / DB / Result / MessageCorrespondent.pm
1 use utf8;
2 package Debbugs::DB::Result::MessageCorrespondent;
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::MessageCorrespondent - Linkage between correspondent and message
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<message_correspondent>
33
34 =cut
35
36 __PACKAGE__->table("message_correspondent");
37
38 =head1 ACCESSORS
39
40 =head2 message
41
42   data_type: 'integer'
43   is_foreign_key: 1
44   is_nullable: 0
45
46 Message id (matches message)
47
48 =head2 correspondent
49
50   data_type: 'integer'
51   is_foreign_key: 1
52   is_nullable: 0
53
54 Correspondent (matches correspondent)
55
56 =head2 correspondent_type
57
58   data_type: 'enum'
59   default_value: 'to'
60   extra: {custom_type_name => "message_correspondent_type",list => ["to","from","envfrom","cc","recv"]}
61   is_nullable: 0
62
63 Type of correspondent (to, from, envfrom, cc, etc.)
64
65 =cut
66
67 __PACKAGE__->add_columns(
68   "message",
69   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
70   "correspondent",
71   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
72   "correspondent_type",
73   {
74     data_type => "enum",
75     default_value => "to",
76     extra => {
77       custom_type_name => "message_correspondent_type",
78       list => ["to", "from", "envfrom", "cc", "recv"],
79     },
80     is_nullable => 0,
81   },
82 );
83
84 =head1 UNIQUE CONSTRAINTS
85
86 =head2 C<message_correspondent_message_correspondent_correspondent_t_idx>
87
88 =over 4
89
90 =item * L</message>
91
92 =item * L</correspondent>
93
94 =item * L</correspondent_type>
95
96 =back
97
98 =cut
99
100 __PACKAGE__->add_unique_constraint(
101   "message_correspondent_message_correspondent_correspondent_t_idx",
102   ["message", "correspondent", "correspondent_type"],
103 );
104
105 =head1 RELATIONS
106
107 =head2 correspondent
108
109 Type: belongs_to
110
111 Related object: L<Debbugs::DB::Result::Correspondent>
112
113 =cut
114
115 __PACKAGE__->belongs_to(
116   "correspondent",
117   "Debbugs::DB::Result::Correspondent",
118   { id => "correspondent" },
119   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
120 );
121
122 =head2 message
123
124 Type: belongs_to
125
126 Related object: L<Debbugs::DB::Result::Message>
127
128 =cut
129
130 __PACKAGE__->belongs_to(
131   "message",
132   "Debbugs::DB::Result::Message",
133   { id => "message" },
134   { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
135 );
136
137
138 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-07 19:03:32
139 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kIhya7skj4ZNM3DkC+gAPw
140
141
142 sub sqlt_deploy_hook {
143     my ($self, $sqlt_table) = @_;
144     for my $idx (qw(correspondent message)) {
145         $sqlt_table->add_index(name => 'message_correspondent_idx'.$idx,
146                                fields => [$idx]);
147     }
148 }
149
150 1;