]> git.donarmstrong.com Git - debbugs.git/blob - lib/Debbugs/DB/Result/Severity.pm
move Debbugs to lib
[debbugs.git] / lib / Debbugs / DB / Result / Severity.pm
1 use utf8;
2 package Debbugs::DB::Result::Severity;
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::Severity - Bug severity
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<severity>
33
34 =cut
35
36 __PACKAGE__->table("severity");
37
38 =head1 ACCESSORS
39
40 =head2 id
41
42   data_type: 'integer'
43   is_auto_increment: 1
44   is_nullable: 0
45   sequence: 'severity_id_seq'
46
47 Severity id
48
49 =head2 severity
50
51   data_type: 'text'
52   is_nullable: 0
53
54 Severity name
55
56 =head2 ordering
57
58   data_type: 'integer'
59   default_value: 5
60   is_nullable: 0
61
62 Severity ordering (more severe severities have higher numbers)
63
64 =head2 strong
65
66   data_type: 'boolean'
67   default_value: false
68   is_nullable: 1
69
70 True if severity is a strong severity
71
72 =head2 obsolete
73
74   data_type: 'boolean'
75   default_value: false
76   is_nullable: 1
77
78 Whether a severity level is obsolete (should not be set on new bugs)
79
80 =cut
81
82 __PACKAGE__->add_columns(
83   "id",
84   {
85     data_type         => "integer",
86     is_auto_increment => 1,
87     is_nullable       => 0,
88     sequence          => "severity_id_seq",
89   },
90   "severity",
91   { data_type => "text", is_nullable => 0 },
92   "ordering",
93   { data_type => "integer", default_value => 5, is_nullable => 0 },
94   "strong",
95   { data_type => "boolean", default_value => \"false", is_nullable => 1 },
96   "obsolete",
97   { data_type => "boolean", default_value => \"false", is_nullable => 1 },
98 );
99
100 =head1 PRIMARY KEY
101
102 =over 4
103
104 =item * L</id>
105
106 =back
107
108 =cut
109
110 __PACKAGE__->set_primary_key("id");
111
112 =head1 UNIQUE CONSTRAINTS
113
114 =head2 C<severity_severity_idx>
115
116 =over 4
117
118 =item * L</severity>
119
120 =back
121
122 =cut
123
124 __PACKAGE__->add_unique_constraint("severity_severity_idx", ["severity"]);
125
126 =head1 RELATIONS
127
128 =head2 bugs
129
130 Type: has_many
131
132 Related object: L<Debbugs::DB::Result::Bug>
133
134 =cut
135
136 __PACKAGE__->has_many(
137   "bugs",
138   "Debbugs::DB::Result::Bug",
139   { "foreign.severity" => "self.id" },
140   { cascade_copy => 0, cascade_delete => 0 },
141 );
142
143
144 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
145 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nI4ZqWa6IW7LgWuG7S1Gog
146
147 sub sqlt_deploy_hook {
148     my ($self, $sqlt_table) = @_;
149     $sqlt_table->add_index(name => 'severity_ordering_idx',
150                            fields => [qw(ordering)],
151                           );
152 }
153
154 1;