X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FCollection.pm;fp=t%2Flib%2FDBICTest%2FSchema%2FCollection.pm;h=1c11dc6faa09acdf4e27eb8f1b5a966826527939;hp=0000000000000000000000000000000000000000;hb=584713f437ffa9390821a0580ed368aa22fb552e;hpb=d93b1239cb7de482ac79a091d7daa67115596306 diff --git a/t/lib/DBICTest/Schema/Collection.pm b/t/lib/DBICTest/Schema/Collection.pm new file mode 100644 index 0000000..1c11dc6 --- /dev/null +++ b/t/lib/DBICTest/Schema/Collection.pm @@ -0,0 +1,30 @@ +package # hide from PAUSE + DBICTest::Schema::Collection; + +use base qw/DBIx::Class::Core/; + +__PACKAGE__->table('collection'); +__PACKAGE__->add_columns( + 'collectionid' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'name' => { + data_type => 'varchar', + size => 100, + }, +); +__PACKAGE__->set_primary_key('collectionid'); + +__PACKAGE__->has_many( collection_object => "DBICTest::Schema::CollectionObject", + { "foreign.collection" => "self.collectionid" } + ); +__PACKAGE__->many_to_many( objects => collection_object => "object" ); +__PACKAGE__->many_to_many( pointy_objects => collection_object => "object", + { where => { "object.type" => "pointy" } } + ); +__PACKAGE__->many_to_many( round_objects => collection_object => "object", + { where => { "object.type" => "round" } } + ); + +1;