summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-10 06:09:18 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-10 06:09:18 +0200
commite0a74d5dafbfa116c2e71c43bf00df46b74540cf (patch)
treef011e1ddce1bd0fedf75b2f77a5ecc7c606e91e7 /Bugzilla/DB
parentba3ebf7be5c1aebec4dcb7d166581aa164024818 (diff)
downloadbugzilla-e0a74d5dafbfa116c2e71c43bf00df46b74540cf.tar.gz
bugzilla-e0a74d5dafbfa116c2e71c43bf00df46b74540cf.tar.xz
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)
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Schema/Pg.pm3
1 files changed, 2 insertions, 1 deletions
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};