might_have with non pk fk
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / DBSchema / Result / User.pm
1 package DBSchema::Result::User;
2
3 # Created by DBIx::Class::Schema::Loader v0.03000 @ 2006-10-02 08:24:09
4
5 use strict;
6 use warnings;
7
8 use base 'DBIx::Class';
9 #use overload '""' => sub {$_[0]->name}, fallback => 1;
10
11 __PACKAGE__->load_components('Core');
12 __PACKAGE__->table("usr");
13 __PACKAGE__->add_columns(
14 "id" => {
15 data_type => 'integer',
16 is_auto_increment => 1,
17 },
18 "username" => {
19 data_type => 'varchar',
20 size => '100',
21 },
22 "password" => {
23 data_type => 'varchar',
24 size => '100',
25 },
26 "name" => {
27 data_type => 'varchar',
28 size => '100',
29 },
30 );
31 __PACKAGE__->set_primary_key("id");
32 __PACKAGE__->has_many("user_roles", "UserRole", { "foreign.user" => "self.id" });
33 __PACKAGE__->has_many("owned_dvds", "Dvd", { "foreign.owner" => "self.id" });
34 __PACKAGE__->has_many(
35 "borrowed_dvds",
36 "Dvd",
37 { "foreign.current_borrower" => "self.id" },
38 );
39 __PACKAGE__->many_to_many('roles', 'user_roles' => 'role');
40
41 __PACKAGE__->might_have(
42 "address",
43 "DBSchema::Result::Address",
44 { 'foreign.user_id' => 'self.id' }
45 );
46
47 1;
48
This page took 0.035696 seconds and 4 git commands to generate.