Firebird: cleanup trigger parsing code a bit
Rafael Kitover [Fri, 5 Mar 2010 23:07:16 +0000 (18:07 -0500)]
lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm

index c8c2fa6..1d62ef9 100644 (file)
@@ -139,11 +139,14 @@ EOF
         my ($quoted, $generator) = $trigger =~
 /(?:gen_id\s* \( \s* |next \s* value \s* for \s*)(")?(\w+)/ix;
 
-        $generator = uc $generator unless $quoted;
-
-        if ((first { $_ eq $column } @trig_cols) && $generator) {
-            $extra_info{is_auto_increment} = 1;
-            $extra_info{sequence}          = $generator;
+        if ($generator) {
+            $generator = uc $generator unless $quoted;
+
+            if (first { $_ eq $column } @trig_cols) {
+                $extra_info{is_auto_increment} = 1;
+                $extra_info{sequence}          = $generator;
+                last;
+            }
         }
     }