]> 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:09:18 +0000 (21:09 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 10 Jul 2010 04:09:18 +0000 (21:09 -0700)
for people upgrading Testopia from 1.3 to 2.0+.
r=mkanat, a=mkanat (module owner)

Bugzilla/DB/Schema/Pg.pm

index 31eedadcb74ff6cc8df440e1123b71d10bc6e039..517837dcc6f09d23f8a56d6e7e02fa1000c0bb34 100644 (file)
@@ -134,9 +134,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};