]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blob - t/lib/DBICTest/Schema/Track.pm
tests from multicreate
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / DBICTest / Schema / Track.pm
1 package # hide from PAUSE
2 DBICTest::Schema::Track;
3
4 use base 'DBIx::Class::Core';
5 __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
6
7 __PACKAGE__->table('track');
8 __PACKAGE__->add_columns(
9 'trackid' => {
10 data_type => 'integer',
11 is_auto_increment => 1,
12 },
13 'cd' => {
14 data_type => 'integer',
15 },
16 'position' => {
17 data_type => 'integer',
18 accessor => 'pos',
19 },
20 'title' => {
21 data_type => 'varchar',
22 size => 100,
23 },
24 last_updated_on => {
25 data_type => 'datetime',
26 accessor => 'updated_date',
27 is_nullable => 1
28 },
29 );
30 __PACKAGE__->set_primary_key('trackid');
31
32 __PACKAGE__->add_unique_constraint([ qw/cd position/ ]);
33 __PACKAGE__->add_unique_constraint([ qw/cd title/ ]);
34
35 __PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );
36 __PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd');
37
38 __PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' );
39 __PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' );
40
41 __PACKAGE__->resultset_class( __PACKAGE__ . '::ResultSet');
42
43 package DBICTest::Schema::Track::ResultSet;
44
45 use base qw( DBIx::Class::ResultSet::RecursiveUpdate );
46
47
48 1;
This page took 0.032968 seconds and 4 git commands to generate.