X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FArtist.pm;h=ae92606aff99f15b5608d15e319f208bd32db681;hb=70c49125fbb6ace2022621dc429f2815407940d9;hp=a412bf040978c63c837c6d3d802231564ab267c9;hpb=c385ecea5ec4297f269bcc2b8db8e08f5772196d;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index a412bf0..ae92606 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -31,6 +31,9 @@ __PACKAGE__->has_many( cds => 'DBICTest::Schema::CD', undef, { order_by => 'year' }, ); +__PACKAGE__->has_many( + cds_unordered => 'DBICTest::Schema::CD' +); __PACKAGE__->has_many( twokeys => 'DBICTest::Schema::TwoKeys' ); __PACKAGE__->has_many( onekeys => 'DBICTest::Schema::OneKey' ); @@ -41,6 +44,14 @@ __PACKAGE__->has_many( { cascade_copy => 0 } # this would *so* not make sense ); -__PACKAGE__->add_index({ name => 'artist_name', fields => ['name'],}); +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'] ) + or die $sqlt_table->error; + } +} 1;