Changeset 350 for veekun/trunk/lib/Vee/Schema/Messages.pm
- Timestamp:
- 10/23/07 01:30:10 (2 years ago)
- Files:
-
- 1 modified
-
veekun/trunk/lib/Vee/Schema/Messages.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
veekun/trunk/lib/Vee/Schema/Messages.pm
r31 r350 3 3 use strict; 4 4 use warnings; 5 6 5 use base 'DBIx::Class'; 7 6 8 __PACKAGE__->load_components("PK::Auto", "Core"); 9 __PACKAGE__->table("messages"); 10 __PACKAGE__->add_columns("id", "from_user_id", "to_user_id", "time", "subject", "message"); 11 __PACKAGE__->set_primary_key("id"); 12 __PACKAGE__->add_unique_constraint(["id"], undef); 7 =head1 NAME 8 9 Vee::Schema::Messages - DBIC class for the C<messages> table 10 11 =cut 12 13 __PACKAGE__->load_components('Core'); 14 __PACKAGE__->table('messages'); 15 __PACKAGE__->add_columns(qw/ id from_user_id to_user_id time subject message /); 16 __PACKAGE__->set_primary_key('id'); 13 17 14 18 __PACKAGE__->belongs_to(recipient => 'Vee::Schema::Users', 'to_user_id'); 15 19 __PACKAGE__->might_have(sender => 'Vee::Schema::Users', { 'foreign.id' => 'self.from_user_id' }); 16 20 21 =head1 SEE ALSO 22 23 L<Vee::Schema>, L<DBIx::Class> 24 25 =head1 AUTHOR 26 27 Maintainer: Alex "Eevee" Munroe (C<veekun@veekun.com>) 28 29 See the included F<AUTHORS> file for a full list of contributers. 30 31 =head1 LICENSE 32 33 See the included F<LICENSE> file. 34 35 =cut 36 17 37 1; 18
