diff options
Diffstat (limited to 'Bugzilla/DB/Schema')
-rw-r--r-- | Bugzilla/DB/Schema/Pg.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Bugzilla/DB/Schema/Pg.pm b/Bugzilla/DB/Schema/Pg.pm index 09e3bfbd4..21b0c6d96 100644 --- a/Bugzilla/DB/Schema/Pg.pm +++ b/Bugzilla/DB/Schema/Pg.pm @@ -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')"); } |