X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FArtist.pm;h=b9794fe0480d9c55c7ca004f87aaf6e33c76c823;hb=65c2b042016f9bd215b8159586da02f9457ebf96;hp=ae92606aff99f15b5608d15e319f208bd32db681;hpb=c193d1d2d7138948d5b5d8b2b7ae19e12edb2cb0;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index ae92606..b9794fe 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -1,7 +1,7 @@ package # hide from PAUSE DBICTest::Schema::Artist; -use base 'DBIx::Class::Core'; +use base qw/DBICTest::BaseResult/; __PACKAGE__->table('artist'); __PACKAGE__->source_info({ @@ -19,6 +19,15 @@ __PACKAGE__->add_columns( size => 100, is_nullable => 1, }, + rank => { + data_type => 'integer', + default_value => 13, + }, + charfield => { + data_type => 'char', + size => 10, + is_nullable => 1, + }, ); __PACKAGE__->set_primary_key('artistid'); @@ -44,12 +53,17 @@ __PACKAGE__->has_many( { cascade_copy => 0 } # this would *so* not make sense ); +__PACKAGE__->has_many( + artist_to_artwork => 'DBICTest::Schema::Artwork_to_Artist' => 'artist_id' +); +__PACKAGE__->many_to_many('artworks', 'artist_to_artwork', 'artwork'); + + sub sqlt_deploy_hook { my ($self, $sqlt_table) = @_; - if ($sqlt_table->schema->translator->producer_type =~ /SQLite$/ ) { - $sqlt_table->add_index( name => 'artist_name', fields => ['name'] ) + $sqlt_table->add_index( name => 'artist_name_hookidx', fields => ['name'] ) or die $sqlt_table->error; } }