# DuplicateColumn and multisite:migrate failed

**URL:** <https://meta.discourse.org/t/duplicatecolumn-and-multisite-migrate-failed/224480>\
**Category:** Bug\
**Created:** [April 16, 2022, 9:57am UTC](https://meta.discourse.org/t/duplicatecolumn-and-multisite-migrate-failed/224480 "2022-04-16T09:57:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jupiter](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jupiter](https://meta.discourse.org/u/jupiter)\
**Post date:** [April 16, 2022, 9:57am UTC](https://meta.discourse.org/t/duplicatecolumn-and-multisite-migrate-failed/224480/1 "2022-04-16T09:57:08Z")

</div>

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](https://meta.discourse.org/t/recovering-from-failed-partially-applied-upgrade/221924) 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](https://github.com/discourse/discourse/pull/16261) (ping @martin?).

After running into the trouble, my quick-and-dirty cure was to:

1. Comment out the line ` - exec: cd /var/www/discourse && sudo -E -u discourse bundle exec rake multisite:migrate` in the configuration file `containers/web_only.yml`.
2. Manually drop the (partially applied?) migrations related to bookmarks: `./launcher enter data` and use `psql` to log in to both my Discourse databases and run `ALTER TABLE bookmarks DROP COLUMN bookmarkable_id, DROP COLUMN bookmarkable_type;`
3. 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. 🤞

---

_[View the full topic](https://meta.discourse.org/t/duplicatecolumn-and-multisite-migrate-failed/224480)._
