X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FArtist.pm;h=c772c5b2557eb8a0c16493e24de899b78b9024b9;hb=a1cb5921a914f087163914b010ca0c4e72a57dcc;hp=90eb7bf064b59c06bdc967532e1ecf8b5f03d748;hpb=7af8b477f07d8ae5b759a285ae95d0c0f1697c8a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 90eb7bf..c772c5b 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -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'); @@ -31,6 +40,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,4 +53,14 @@ __PACKAGE__->has_many( { cascade_copy => 0 } # this would *so* not make sense ); +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;