From: Max Kanat-Alexander Date: Tue, 13 Jul 2010 00:38:53 +0000 (-0700) Subject: Bug 578197: [PostgreSQL] When associating sequences with columns, also X-Git-Tag: bugzilla-4.1.1~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47eb776b6c3b5e92bc13394440d99440cb2a4235;p=thirdparty%2Fbugzilla.git Bug 578197: [PostgreSQL] When associating sequences with columns, also fix the default of the columns so that it's identical to what a new checksetup run would create. r=mkanat, a=mkanat (module owner) --- diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 8ed7368aad..0373fb1ce0 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -296,6 +296,12 @@ END print "Fixing $sequence to be associated" . " with $table.$column...\n"; $self->do("ALTER SEQUENCE $sequence OWNED BY $table.$column"); + # In order to produce an exactly identical schema to what + # a brand-new checksetup.pl run would produce, we also need + # to re-set the default on this column. + $self->do("ALTER TABLE $table + ALTER COLUMN $column + SET DEFAULT nextval('$sequence')"); } } }