]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/MessageCorrespondent.pm
update db::result class and add correspondent and message correspondent
[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 =back
25
26 =cut
27
28 __PACKAGE__->load_components("InflateColumn::DateTime");
29
30 =head1 TABLE: C<message_correspondent>
31
32 =cut
33
34 __PACKAGE__->table("message_correspondent");
35
36 =head1 ACCESSORS
37
38 =head2 message
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 0
43
44 Message id (matches message)
45
46 =head2 correspondent
47
48   data_type: 'integer'
49   is_foreign_key: 1
50   is_nullable: 0
51
52 Correspondent (matches correspondent)
53
54 =head2 correspondent_type
55
56   data_type: 'enum'
57   default_value: 'to'
58   extra: {custom_type_name => "message_correspondent_type",list => ["to","from","envfrom","cc"]}
59   is_nullable: 0
60
61 Type of correspondent (to, from, envfrom, cc, etc.)
62
63 =cut
64
65 __PACKAGE__->add_columns(
66   "message",
67   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
68   "correspondent",
69   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
70   "correspondent_type",
71   {
72     data_type => "enum",
73     default_value => "to",
74     extra => {
75       custom_type_name => "message_correspondent_type",
76       list => ["to", "from", "envfrom", "cc"],
77     },
78     is_nullable => 0,
79   },
80 );
81
82 =head1 UNIQUE CONSTRAINTS
83
84 =head2 C<message_correspondent_message_correspondent_correspondent_t_idx>
85
86 =over 4
87
88 =item * L</message>
89
90 =item * L</correspondent>
91
92 =item * L</correspondent_type>
93
94 =back
95
96 =cut
97
98 __PACKAGE__->add_unique_constraint(
99   "message_correspondent_message_correspondent_correspondent_t_idx",
100   ["message", "correspondent", "correspondent_type"],
101 );
102
103 =head1 RELATIONS
104
105 =head2 correspondent
106
107 Type: belongs_to
108
109 Related object: L<Debbugs::DB::Result::Correspondent>
110
111 =cut
112
113 __PACKAGE__->belongs_to(
114   "correspondent",
115   "Debbugs::DB::Result::Correspondent",
116   { id => "correspondent" },
117   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
118 );
119
120 =head2 message
121
122 Type: belongs_to
123
124 Related object: L<Debbugs::DB::Result::Message>
125
126 =cut
127
128 __PACKAGE__->belongs_to(
129   "message",
130   "Debbugs::DB::Result::Message",
131   { id => "message" },
132   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
133 );
134
135
136 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43
137 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wo2PGK4VpJ1hB8YBJ9QNUg
138
139
140 # You can replace this text with custom code or comments, and it will be preserved on regeneration
141 1;