]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/DB/Result/UserTag.pm
switch to compatibility level 12
[debbugs.git] / Debbugs / DB / Result / UserTag.pm
1 use utf8;
2 package Debbugs::DB::Result::UserTag;
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::UserTag - User bug tags
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<user_tag>
33
34 =cut
35
36 __PACKAGE__->table("user_tag");
37
38 =head1 ACCESSORS
39
40 =head2 id
41
42   data_type: 'integer'
43   is_auto_increment: 1
44   is_nullable: 0
45   sequence: 'user_tag_id_seq'
46
47 User bug tag id
48
49 =head2 tag
50
51   data_type: 'text'
52   is_nullable: 0
53
54 User bug tag name
55
56 =head2 correspondent
57
58   data_type: 'integer'
59   is_foreign_key: 1
60   is_nullable: 0
61
62 User bug tag correspondent
63
64 =cut
65
66 __PACKAGE__->add_columns(
67   "id",
68   {
69     data_type         => "integer",
70     is_auto_increment => 1,
71     is_nullable       => 0,
72     sequence          => "user_tag_id_seq",
73   },
74   "tag",
75   { data_type => "text", is_nullable => 0 },
76   "correspondent",
77   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
78 );
79
80 =head1 PRIMARY KEY
81
82 =over 4
83
84 =item * L</id>
85
86 =back
87
88 =cut
89
90 __PACKAGE__->set_primary_key("id");
91
92 =head1 UNIQUE CONSTRAINTS
93
94 =head2 C<user_tag_tag_correspondent>
95
96 =over 4
97
98 =item * L</tag>
99
100 =item * L</correspondent>
101
102 =back
103
104 =cut
105
106 __PACKAGE__->add_unique_constraint("user_tag_tag_correspondent", ["tag", "correspondent"]);
107
108 =head1 RELATIONS
109
110 =head2 bug_user_tags
111
112 Type: has_many
113
114 Related object: L<Debbugs::DB::Result::BugUserTag>
115
116 =cut
117
118 __PACKAGE__->has_many(
119   "bug_user_tags",
120   "Debbugs::DB::Result::BugUserTag",
121   { "foreign.user_tag" => "self.id" },
122   { cascade_copy => 0, cascade_delete => 0 },
123 );
124
125 =head2 correspondent
126
127 Type: belongs_to
128
129 Related object: L<Debbugs::DB::Result::Correspondent>
130
131 =cut
132
133 __PACKAGE__->belongs_to(
134   "correspondent",
135   "Debbugs::DB::Result::Correspondent",
136   { id => "correspondent" },
137   { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
138 );
139
140
141 # Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-09-24 14:51:07
142 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZPmTBeTue62dG2NdQdPrQg
143
144 sub sqlt_deploy_hook {
145     my ($self, $sqlt_table) = @_;
146     $sqlt_table->add_index(name => 'user_tag_correspondent',
147                            fields => [qw(correspondent)],
148                           );
149 }
150
151 1;