diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-13 02:38:53 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-13 02:38:53 +0200 |
commit | 47eb776b6c3b5e92bc13394440d99440cb2a4235 (patch) | |
tree | 708f94fc92f50d178439b0d8edb88d723d2a1e79 | |
parent | 31ffa56311523fcd47e2ae99f8636586cd005c56 (diff) | |
download | bugzilla-47eb776b6c3b5e92bc13394440d99440cb2a4235.tar.gz bugzilla-47eb776b6c3b5e92bc13394440d99440cb2a4235.tar.xz |
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)
-rw-r--r-- | Bugzilla/DB/Pg.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 8ed7368aa..0373fb1ce 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')"); } } } |