# 从失败/部分应用的升级中恢复

**URL:** https://meta.discourse.org/t/recovering-from-failed-partially-applied-upgrade/221924
**Category:** Self-hosting
**Created:** [2022年三月24日 21:25 UTC](https://meta.discourse.org/t/recovering-from-failed-partially-applied-upgrade/221924 "2022-03-24T21:25:17Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![undasein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/undasein/32/222392_2.png) [@undasein](https://meta.discourse.org/u/undasein)
#### Post date: [2022年三月31日 13:55 UTC](https://meta.discourse.org/t/recovering-from-failed-partially-applied-upgrade/221924/7 "2022-03-31T13:55:23Z")

</div>

看看这个：

> [@Error upgrading, failed to bootstrap](https://meta.discourse.org/t/error-upgrading-failed-to-bootstrap/221871/17?u=undasein):
>
> Sorry. I’m on my phone and not quite thinking well enough to explain… After the start app su - postgres psql discourse And then the drop table discourse\_reactions\_reactions ; And then type exit or control-d a few times to get out of everything

我清空了所有报错的表（一个接一个，最后有7个），直到可以无误地重建应用。

在你的例子中，问题似乎是一个列：

`PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists`

也许你应该找到它属于哪个表，以便清空它，或者你也可以直接删除该列。

我相信问题在于，在部分迁移时，这些表已经创建了，因此无法再次创建并报错。也许可以为这个过程添加一个条件，这样就不会报错了？（我不是专家） @pfaffman

---

_[View the full topic](https://meta.discourse.org/t/recovering-from-failed-partially-applied-upgrade/221924)._
