Commit e0a74d5d authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

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)
parent ba3ebf7b
......@@ -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};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment