]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blob - t/lib/DBSchema/Result/Dvd.pm
m2m accepts one element instead of an arrayref; id as generic pk
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / DBSchema / Result / Dvd.pm
1 package DBSchema::Result::Dvd;
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(qw/IntrospectableM2M Core/);
12 __PACKAGE__->table('dvd');
13 __PACKAGE__->add_columns(
14 'dvd_id' => {
15 data_type => 'integer',
16 is_auto_increment => 1
17 },
18 'name' => {
19 data_type => 'varchar',
20 size => 100,
21 is_nullable => 1,
22 },
23 'imdb_id' => {
24 data_type => 'varchar',
25 size => 100,
26 is_nullable => 1,
27 },
28 'owner' => { data_type => 'integer' },
29 'current_borrower' => {
30 data_type => 'integer',
31 is_nullable => 1,
32 },
33
34 'creation_date' => {
35 data_type => 'datetime',
36 is_nullable => 1,
37 },
38 'alter_date' => {
39 data_type => 'datetime',
40 is_nullable => 1,
41 },
42 'twokeysfk' => {
43 data_type => 'integer',
44 is_nullable => 1,
45 },
46 );
47 __PACKAGE__->set_primary_key('dvd_id');
48 __PACKAGE__->belongs_to('owner', 'DBSchema::Result::User', { id => 'owner' });
49 __PACKAGE__->belongs_to('current_borrower', 'DBSchema::Result::User', { id => 'current_borrower' });
50 __PACKAGE__->has_many('dvdtags', 'Dvdtag', { 'foreign.dvd' => 'self.dvd_id' });
51 __PACKAGE__->has_many('viewings', 'DBSchema::Result::Viewing', { 'foreign.dvd_id' => 'self.dvd_id' });
52 __PACKAGE__->many_to_many('tags', 'dvdtags' => 'tag');
53 __PACKAGE__->might_have(
54 liner_notes => 'DBSchema::Result::LinerNotes', undef,
55 { proxy => [ qw/notes/ ] },
56 );
57 __PACKAGE__->add_relationship('like_has_many', 'DBSchema::Result::Twokeys', { 'foreign.dvd_name' => 'self.name' }, { accessor_name => 'like_has_many' } );
58 __PACKAGE__->add_relationship('like_has_many2', 'DBSchema::Result::Twokeys_belongsto',
59 { 'foreign.key1' => 'self.twokeysfk' },
60 );
61
62 1;
63
This page took 0.032474 seconds and 4 git commands to generate.