From e0a74d5dafbfa116c2e71c43bf00df46b74540cf Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Fri, 9 Jul 2010 21:09:18 -0700 Subject: Bug 451219: Allow altering from one SERIAL type to another on PostgreSQL, for people upgrading Testopia from 1.3 to 2.0+. r=mkanat, a=mkanat (module owner) --- Bugzilla/DB/Schema/Pg.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/DB/Schema/Pg.pm b/Bugzilla/DB/Schema/Pg.pm index 31eedadcb..517837dcc 100644 --- a/Bugzilla/DB/Schema/Pg.pm +++ b/Bugzilla/DB/Schema/Pg.pm @@ -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}; -- cgit v1.2.3-24-g4f1b