X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FTreeLike.pm;h=b5b276317703d4c2fd047e6407e329b5805d8280;hb=89cf6a706832b79c02f980077bd30525b3716ee0;hp=297cfc6395fa81a331deb64fbd534269e7dd14db;hpb=af4cd3e568e12a5060078abbae021c8259e5512d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/TreeLike.pm b/t/lib/DBICTest/Schema/TreeLike.pm index 297cfc6..b5b2763 100644 --- a/t/lib/DBICTest/Schema/TreeLike.pm +++ b/t/lib/DBICTest/Schema/TreeLike.pm @@ -16,4 +16,12 @@ __PACKAGE__->belongs_to('parent', 'TreeLike', { 'foreign.id' => 'self.parent' }); __PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent' => 'self.id' }); +## since this is a self referential table we need to do a post deploy hook and get +## some data in while constraints are off + + sub sqlt_deploy_hook { + my ($self, $sqlt_table) = @_; + + $sqlt_table->add_index(name => 'idx_name', fields => ['name']); + } 1;