Upgrading from 2.9.0.beta2 to 2.9.0.beta4 failed with error message PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists
. The advice in Recovering from failed/partially applied upgrade helped me to get back online again. I’m starting a new topic because this issue seems to be specifically about a (dockerized) multisite install.
The issue seems to be multisite:migrate
trying to run again the same migration that was already ran as part of the earlier migrations. The result was PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists
. Based on the error message this could to be related to the polymorphic bookmarks feature, DEV: Re-add polymorphic bookmark columns by martin-brennan · Pull Request #16261 · discourse/discourse · GitHub (ping @martin?).
After running into the trouble, my quick-and-dirty cure was to:
- Comment out the line
- exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
in the configuration filecontainers/web_only.yml
. - Manually drop the (partially applied?) migrations related to bookmarks:
./launcher enter data
and usepsql
to log in to both my Discourse databases and runALTER TABLE bookmarks DROP COLUMN bookmarkable_id, DROP COLUMN bookmarkable_type;
- Re-run the rebuild:
./launcher rebuild web_only 2>&1
What might I be missing now that the multisite:migrate
was not executed? I’d appreciate any thoughts. Both sites seem to work though.