Remove add_index and replace it with sqlt_deploy_hook
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Artist.pm
index a412bf0..424fbe9 100644 (file)
@@ -41,6 +41,11 @@ __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) = @_;
+
+  $sqlt_table->add_index( name => 'artist_name', fields => ['name'] )
+    or die $sqlt_table->error;
+}
 
 1;