]> git.donarmstrong.com Git - debbugs.git/blob - lib/Debbugs/DB/Result/CorrespondentFullName.pm
correct correspondent full name (db version now 13)
[debbugs.git] / lib / Debbugs / DB / Result / CorrespondentFullName.pm
1 use utf8;
2 package Debbugs::DB::Result::CorrespondentFullName;
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::CorrespondentFullName - Full names of BTS correspondents
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<correspondent_full_name>
33
34 =cut
35
36 __PACKAGE__->table("correspondent_full_name");
37
38 =head1 ACCESSORS
39
40 =head2 correspondent
41
42   data_type: 'integer'
43   is_foreign_key: 1
44   is_nullable: 0
45
46 Correspondent ID (matches correspondent)
47
48 =head2 full_addr
49
50   data_type: 'text'
51   is_nullable: 0
52
53 =head2 name
54
55   data_type: 'text'
56   default_value: (empty string)
57   is_nullable: 0
58
59 =head2 last_seen
60
61   data_type: 'timestamp with time zone'
62   default_value: current_timestamp
63   is_nullable: 0
64   original: {default_value => \"now()"}
65
66 =cut
67
68 __PACKAGE__->add_columns(
69   "correspondent",
70   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
71   "full_addr",
72   { data_type => "text", is_nullable => 0 },
73   "name",
74   { data_type => "text", default_value => "", is_nullable => 0 },
75   "last_seen",
76   {
77     data_type     => "timestamp with time zone",
78     default_value => \"current_timestamp",
79     is_nullable   => 0,
80     original      => { default_value => \"now()" },
81   },
82 );
83
84 =head1 UNIQUE CONSTRAINTS
85
86 =head2 C<correspondent_full_name_correspondent_full_name_idx>
87
88 =over 4
89
90 =item * L</correspondent>
91
92 =item * L</full_addr>
93
94 =back
95
96 =cut
97
98 __PACKAGE__->add_unique_constraint(
99   "correspondent_full_name_correspondent_full_name_idx",
100   ["correspondent", "full_addr"],
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 => 0, on_delete => "CASCADE", on_update => "CASCADE" },
118 );
119
120
121 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-01 13:43:06
122 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3IdwxC/wrKHGQT05XYLDYg
123
124 sub sqlt_deploy_hook {
125     my ($self, $sqlt_table) = @_;
126     for my $idx (qw(full_name last_seen)) {
127         $sqlt_table->add_index(name => 'correspondent_full_name_idx_'.$idx,
128                                fields => [$idx]);
129     }
130 }
131
132 1;