X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FFourKeys.pm;h=9966cfbc407343cafce16364ee99968732d41783;hb=97c96475;hp=71659e6b4e837d394ca642fbc7fba0b2ee2c90cc;hpb=c6d74d3ead7c87c6c63997b8e39fa638f4851559;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/FourKeys.pm b/t/lib/DBICTest/Schema/FourKeys.pm index 71659e6..9966cfb 100644 --- a/t/lib/DBICTest/Schema/FourKeys.pm +++ b/t/lib/DBICTest/Schema/FourKeys.pm @@ -1,15 +1,29 @@ package # hide from PAUSE DBICTest::Schema::FourKeys; -use base 'DBIx::Class::Core'; +use base qw/DBICTest::BaseResult/; -DBICTest::Schema::FourKeys->table('fourkeys'); -DBICTest::Schema::FourKeys->add_columns( +__PACKAGE__->table('fourkeys'); +__PACKAGE__->add_columns( 'foo' => { data_type => 'integer' }, 'bar' => { data_type => 'integer' }, 'hello' => { data_type => 'integer' }, 'goodbye' => { data_type => 'integer' }, + 'sensors' => { data_type => 'character', size => 10 }, + 'read_count' => { data_type => 'integer', is_nullable => 1 }, +); +__PACKAGE__->set_primary_key(qw/foo bar hello goodbye/); + +__PACKAGE__->has_many( + 'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', { + 'foreign.f_foo' => 'self.foo', + 'foreign.f_bar' => 'self.bar', + 'foreign.f_hello' => 'self.hello', + 'foreign.f_goodbye' => 'self.goodbye', +}); + +__PACKAGE__->many_to_many( + 'twokeys', 'fourkeys_to_twokeys', 'twokeys', ); -DBICTest::Schema::FourKeys->set_primary_key(qw/foo bar hello goodbye/); 1;