X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fchatty;a=blobdiff_plain;f=lib%2FChatty%2FSchema%2FResult%2FAccount.pm;h=60b33b1826d7441833539f8384eeddd281e0b4b6;hp=1589333de1493d2947b0c62d960bb54e4a6ba2a8;hb=d2a57728529b95fa1c2e3da677e64c848e7d065b;hpb=20e8ae6917f72f3c381ad9d3aca656a99bd4cd7f diff --git a/lib/Chatty/Schema/Result/Account.pm b/lib/Chatty/Schema/Result/Account.pm index 1589333..60b33b1 100644 --- a/lib/Chatty/Schema/Result/Account.pm +++ b/lib/Chatty/Schema/Result/Account.pm @@ -11,7 +11,7 @@ use MooseX::NonMoose; use namespace::autoclean; extends 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +__PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp"); =head1 NAME @@ -29,6 +29,11 @@ __PACKAGE__->table("account"); is_auto_increment: 1 is_nullable: 0 +=head2 email + + data_type: 'text' + is_nullable: 1 + =head2 username data_type: 'text' @@ -37,7 +42,7 @@ __PACKAGE__->table("account"); =head2 password data_type: 'text' - is_nullable: 1 + is_nullable: 0 =head2 status @@ -45,22 +50,53 @@ __PACKAGE__->table("account"); default_value: 'active' is_nullable: 1 +=head2 current_room + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "email", + { data_type => "text", is_nullable => 1 }, "username", { data_type => "text", is_nullable => 1 }, "password", - { data_type => "text", is_nullable => 1 }, + { data_type => "text", is_nullable => 0 }, "status", { data_type => "text", default_value => "active", is_nullable => 1 }, + "current_room", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); +__PACKAGE__->add_unique_constraint("username_unique", ["username"]); =head1 RELATIONS +=head2 current_room + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "current_room", + "Chatty::Schema::Result::Room", + { id => "current_room" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 messages Type: has_many @@ -77,8 +113,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-12 22:20:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D8HUHJmSfJwylSeDYjfeHA +# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-17 20:21:50 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jbeLiaDPsjHNHj5O11tPFA # You can replace this text with custom code or comments, and it will be preserved on regeneration