]> Dogcows Code - chaz/chatty/blob - lib/Chatty/Schema/Result/Account.pm
60b33b1826d7441833539f8384eeddd281e0b4b6
[chaz/chatty] / lib / Chatty / Schema / Result / Account.pm
1 package Chatty::Schema::Result::Account;
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::Account
19
20 =cut
21
22 __PACKAGE__->table("account");
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 email
33
34 data_type: 'text'
35 is_nullable: 1
36
37 =head2 username
38
39 data_type: 'text'
40 is_nullable: 1
41
42 =head2 password
43
44 data_type: 'text'
45 is_nullable: 0
46
47 =head2 status
48
49 data_type: 'text'
50 default_value: 'active'
51 is_nullable: 1
52
53 =head2 current_room
54
55 data_type: 'integer'
56 is_foreign_key: 1
57 is_nullable: 1
58
59 =cut
60
61 __PACKAGE__->add_columns(
62 "id",
63 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
64 "email",
65 { data_type => "text", is_nullable => 1 },
66 "username",
67 { data_type => "text", is_nullable => 1 },
68 "password",
69 { data_type => "text", is_nullable => 0 },
70 "status",
71 { data_type => "text", default_value => "active", is_nullable => 1 },
72 "current_room",
73 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
74 );
75 __PACKAGE__->set_primary_key("id");
76 __PACKAGE__->add_unique_constraint("username_unique", ["username"]);
77
78 =head1 RELATIONS
79
80 =head2 current_room
81
82 Type: belongs_to
83
84 Related object: L<Chatty::Schema::Result::Room>
85
86 =cut
87
88 __PACKAGE__->belongs_to(
89 "current_room",
90 "Chatty::Schema::Result::Room",
91 { id => "current_room" },
92 {
93 is_deferrable => 1,
94 join_type => "LEFT",
95 on_delete => "CASCADE",
96 on_update => "CASCADE",
97 },
98 );
99
100 =head2 messages
101
102 Type: has_many
103
104 Related object: L<Chatty::Schema::Result::Message>
105
106 =cut
107
108 __PACKAGE__->has_many(
109 "messages",
110 "Chatty::Schema::Result::Message",
111 { "foreign.author" => "self.id" },
112 { cascade_copy => 0, cascade_delete => 0 },
113 );
114
115
116 # Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-17 20:21:50
117 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jbeLiaDPsjHNHj5O11tPFA
118
119
120 # You can replace this text with custom code or comments, and it will be preserved on regeneration
121 __PACKAGE__->meta->make_immutable;
122 1;
This page took 0.0403289999999999 seconds and 3 git commands to generate.