X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FVersioned.pm;h=5a861baa5699cf1a089d823114cfb2cbd96f21ae;hp=052f8e7d1ef2b38f0e463eb03a55e3931b708fba;hb=c271eec382194b5c1b50931ef07c652e7ea653d2;hpb=70fbb0b83da0330bd1d8df7d315561cfd7e92fe7 diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index 052f8e7..5a861ba 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -725,9 +725,12 @@ sub _source_exists { my ($self, $rs) = @_; - my $c = try { $rs->search({ 1, 0 })->count }; - - return (defined $c) ? 1 : 0; + return try { + $rs->search(\'1=0')->cursor->next; + 1; + } catch { + 0; + }; } 1;