modified schema to support chat rooms
[chaz/chatty] / lib / Chatty / Schema / Result / Room.pm
1 package Chatty::Schema::Result::Room;
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::Room
19
20 =cut
21
22 __PACKAGE__->table("room");
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 name
33
34 data_type: 'text'
35 is_nullable: 1
36
37 =head2 created
38
39 data_type: 'timestamp'
40 default_value: NOW
41 is_nullable: 1
42
43 =cut
44
45 __PACKAGE__->add_columns(
46 "id",
47 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
48 "name",
49 { data_type => "text", is_nullable => 1 },
50 "created",
51 { data_type => "timestamp", default_value => \"NOW", is_nullable => 1 },
52 );
53 __PACKAGE__->set_primary_key("id");
54
55 =head1 RELATIONS
56
57 =head2 accounts
58
59 Type: has_many
60
61 Related object: L<Chatty::Schema::Result::Account>
62
63 =cut
64
65 __PACKAGE__->has_many(
66 "accounts",
67 "Chatty::Schema::Result::Account",
68 { "foreign.current_room" => "self.id" },
69 { cascade_copy => 0, cascade_delete => 0 },
70 );
71
72 =head2 messages
73
74 Type: has_many
75
76 Related object: L<Chatty::Schema::Result::Message>
77
78 =cut
79
80 __PACKAGE__->has_many(
81 "messages",
82 "Chatty::Schema::Result::Message",
83 { "foreign.room" => "self.id" },
84 { cascade_copy => 0, cascade_delete => 0 },
85 );
86
87
88 # Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-13 18:47:53
89 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2QSf3vZfv8xVbUKtsKsvDg
90
91
92 # You can replace this text with custom code or comments, and it will be preserved on regeneration
93 __PACKAGE__->meta->make_immutable;
94 1;
This page took 0.036466 seconds and 4 git commands to generate.