better case-sensitivity detection for MSSQL
Rafael Kitover [Mon, 29 Mar 2010 10:58:41 +0000 (06:58 -0400)]
lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm

index debfbde..8606a2e 100644 (file)
@@ -56,9 +56,9 @@ sub _setup {
         return;
     }
 
-    my ($sensitivity) = $collation_name =~ /(C\w)_[A-z]+\z/;
+    my $case_sensitive = $collation_name =~ /_(?:CS|BIN2?)(?:_|\z)/;
 
-    $self->case_sensitive_collation($sensitivity eq 'CS' ? 1 : 0);
+    $self->case_sensitive_collation($case_sensitive ? 1 : 0);
 }
 
 sub _lc {