X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FBooksInLibrary.pm;h=24d5657f83c81a16e223cf8f5dee383be6b72b5e;hb=0e773352a9c6c034dfb2526b8d68bf6ac1e2323b;hp=6c2d6aa624bb05d4fb55f8e71b155d508a43858b;hpb=cda5e0825360a15f97520dae86864b68ac90d5f5;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/BooksInLibrary.pm b/t/lib/DBICTest/Schema/BooksInLibrary.pm index 6c2d6aa..24d5657 100644 --- a/t/lib/DBICTest/Schema/BooksInLibrary.pm +++ b/t/lib/DBICTest/Schema/BooksInLibrary.pm @@ -1,32 +1,36 @@ -package # hide from PAUSE - DBICTest::Schema::BooksInLibrary; - -use base qw/DBIx::Class::Core/; - -__PACKAGE__->table('books'); -__PACKAGE__->add_columns( - 'id' => { - data_type => 'integer', - is_auto_increment => 1, - }, - 'source' => { - data_type => 'varchar', - size => '100', - }, - 'owner' => { - data_type => 'integer', - }, - 'title' => { - data_type => 'varchar', - size => '100', - }, - 'price' => { - data_type => 'integer', - is_nullable => 1, - }, -); -__PACKAGE__->set_primary_key('id'); - -__PACKAGE__->resultset_attributes({where => { source => "Library" } }); - -1; +package # hide from PAUSE + DBICTest::Schema::BooksInLibrary; + +use base qw/DBICTest::BaseResult/; + +__PACKAGE__->table('books'); +__PACKAGE__->add_columns( + 'id' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'source' => { + data_type => 'varchar', + size => '100', + }, + 'owner' => { + data_type => 'integer', + }, + 'title' => { + data_type => 'varchar', + size => '100', + }, + 'price' => { + data_type => 'integer', + is_nullable => 1, + }, +); +__PACKAGE__->set_primary_key('id'); + +__PACKAGE__->add_unique_constraint (['title']); + +__PACKAGE__->resultset_attributes({where => { source => "Library" } }); + +__PACKAGE__->belongs_to ( owner => 'DBICTest::Schema::Owners', 'owner' ); + +1;