This repository has been archived by the owner on Jun 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Announcement.pm
105 lines (76 loc) · 1.75 KB
/
Announcement.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package Maximus::Schema::Result::Announcement;
# Created by DBIx::Class::Schema::Loader
use strict;
use warnings;
use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';
__PACKAGE__->load_components("InflateColumn::DateTime");
=head1 NAME
Maximus::Schema::Result::Announcement
=cut
__PACKAGE__->table("announcement");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
extra: {unsigned => 1}
is_auto_increment: 1
is_nullable: 0
=head2 date
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 0
=head2 message
data_type: 'text'
is_nullable: 0
=head2 message_type
data_type: 'varchar'
is_nullable: 0
size: 45
=head2 meta_data
data_type: 'text'
is_nullable: 1
=cut
__PACKAGE__->add_columns(
"id",
{
data_type => "integer",
extra => { unsigned => 1 },
is_auto_increment => 1,
is_nullable => 0,
},
"date",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 0,
},
"message",
{ data_type => "text", is_nullable => 0 },
"message_type",
{ data_type => "varchar", is_nullable => 0, size => 45 },
"meta_data",
{ data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");
# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-05-14 15:41:53
use JSON::Any;
__PACKAGE__->inflate_column(
'meta_data',
{ inflate => sub { JSON::Any->jsonToObj(shift || '{}') },
deflate => sub { JSON::Any->objToJson(shift || {}) },
}
);
=head2 sqlt_deploy_hook
Force MySQL to use InnoDB and UTF-8
=cut
sub sqlt_deploy_hook {
my ($self, $sqlt_table) = @_;
$sqlt_table->extra(
mysql_table_type => 'InnoDB',
mysql_charset => 'utf8'
);
}
__PACKAGE__->meta->make_immutable;
1;