mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Bug 352967: [PostgreSQL] Changing a DB column type to "serial" is broken on PostgreSQL 8.1 - Patch by R�mi Zara <remi_zara@mac.com> r=mkanat a=myk
This commit is contained in:
parent
2e0d57d2af
commit
437cb983e4
@ -120,7 +120,8 @@ sub _get_alter_type_sql {
|
||||
if ($new_def->{TYPE} =~ /serial/i && $old_def->{TYPE} !~ /serial/i) {
|
||||
push(@statements, "CREATE SEQUENCE ${table}_${column}_seq");
|
||||
push(@statements, "SELECT setval('${table}_${column}_seq',
|
||||
MAX($table.$column))");
|
||||
MAX($table.$column))
|
||||
FROM $table");
|
||||
push(@statements, "ALTER TABLE $table ALTER COLUMN $column
|
||||
SET DEFAULT nextval('${table}_${column}_seq')");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user