]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 451219: Allow altering from one SERIAL type to another on PostgreSQL,
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 10 Jul 2010 04:10:46 +0000 (21:10 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 10 Jul 2010 04:10:46 +0000 (21:10 -0700)
for people upgrading Testopia from 1.3 to 2.0+.
r=mkanat, a=mkanat (module owner)

Bugzilla/DB/Schema/Pg.pm

index 3559bae9c9abb66a3361b7cfbc6487c64ed6374d..0b10acbb09fde9e9b9f5290de0ecbc891c4d2a74 100644 (file)
@@ -136,9 +136,10 @@ sub _get_alter_type_sql {
     if ($type =~ /serial/i && $old_def->{TYPE} !~ /serial/i) {
         die("You cannot specify a DEFAULT on a SERIAL-type column.") 
             if $new_def->{DEFAULT};
-        $type =~ s/serial/integer/i;
     }
 
+    $type =~ s/\bserial\b/integer/i;
+
     # On Pg, you don't need UNIQUE if you're a PK--it creates
     # two identical indexes otherwise.
     $type =~ s/unique//i if $new_def->{PRIMARYKEY};