更新 = ☠

A few things if someone else gets stuck this way.

First, don’t run a ./launcher cleanup, instead run a ./launcher start app to restart your existing container. Then you’d be able to do something like

./launcher enter app
su - postgres
psql discourse
drop table ...

Without the container to enter and talk direclty to postgres, you have to do it during the container build by adding something like this to your app.yml:

hooks:
  after_postgres:
      - exec: /bin/bash -c 'sudo -u postgres psql discourse <<< "drop table summary_sections;"'
      - exec: /bin/bash -c 'sudo -u postgres psql discourse <<< "drop table theme_settings_migrations;"'

I don’t know how it was that those two tables got created such that the migrations were out of whack, but this was a fix. And it was stranger than that, because the database had somehow been wiped and once I fixed this it was a brand new database, so it must have somehow been stopped in the middle of a migration at some point.

8 个赞