modified schema to support chat rooms
[chaz/chatty] / lib / Chatty / Schema / Result / Message.pm
1 package Chatty::Schema::Result::Message;
2
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5
6 use strict;
7 use warnings;
8
9 use Moose;
10 use MooseX::NonMoose;
11 use namespace::autoclean;
12 extends 'DBIx::Class::Core';
13
14 __PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp");
15
16 =head1 NAME
17
18 Chatty::Schema::Result::Message
19
20 =cut
21
22 __PACKAGE__->table("message");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
31
32 =head2 posted
33
34 data_type: 'timestamp'
35 default_value: NOW
36 is_nullable: 1
37
38 =head2 author
39
40 data_type: 'integer'
41 is_foreign_key: 1
42 is_nullable: 1
43
44 =head2 room
45
46 data_type: 'integer'
47 is_foreign_key: 1
48 is_nullable: 1
49
50 =head2 content
51
52 data_type: 'text'
53 is_nullable: 1
54
55 =cut
56
57 __PACKAGE__->add_columns(
58 "id",
59 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
60 "posted",
61 { data_type => "timestamp", default_value => \"NOW", is_nullable => 1 },
62 "author",
63 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
64 "room",
65 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
66 "content",
67 { data_type => "text", is_nullable => 1 },
68 );
69 __PACKAGE__->set_primary_key("id");
70
71 =head1 RELATIONS
72
73 =head2 room
74
75 Type: belongs_to
76
77 Related object: L<Chatty::Schema::Result::Room>
78
79 =cut
80
81 __PACKAGE__->belongs_to(
82 "room",
83 "Chatty::Schema::Result::Room",
84 { id => "room" },
85 {
86 is_deferrable => 1,
87 join_type => "LEFT",
88 on_delete => "CASCADE",
89 on_update => "CASCADE",
90 },
91 );
92
93 =head2 author
94
95 Type: belongs_to
96
97 Related object: L<Chatty::Schema::Result::Account>
98
99 =cut
100
101 __PACKAGE__->belongs_to(
102 "author",
103 "Chatty::Schema::Result::Account",
104 { id => "author" },
105 {
106 is_deferrable => 1,
107 join_type => "LEFT",
108 on_delete => "CASCADE",
109 on_update => "CASCADE",
110 },
111 );
112
113
114 # Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-13 18:47:53
115 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q1cq2bWftQPoo8huOftzMQ
116
117
118 # You can replace this text with custom code or comments, and it will be preserved on regeneration
119 __PACKAGE__->meta->make_immutable;
120 1;
This page took 0.036929 seconds and 4 git commands to generate.