Discourse Voting 在 postgresql 中找不到表

安装 GitHub - discourse/discourse-topic-voting: Adds the ability for voting on a topic within a specified category in Discourse. · GitHub 后,我在日志(Docker)中收到以下错误:

discourse           | Started GET "/" for 2.3.75.18 at 2020-10-22 17:36:58 +0000
discourse           | Processing by ListController#latest as HTML
discourse_db        | 2020-10-22 17:36:59.073 UTC [2221] ERROR:  relation "discourse_voting_category_settings" does not exist at character 454
discourse_db        | 2020-10-22 17:36:59.073 UTC [2221] STATEMENT:  SELECT a.attname, format_type(a.atttypid, a.atttypmod),
discourse_db        |        pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
discourse_db        |        c.collname, col_description(a.attrelid, a.attnum) AS comment
discourse_db        |   FROM pg_attribute a
discourse_db        |   LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
discourse_db        |   LEFT JOIN pg_type t ON a.atttypid = t.oid
discourse_db        |   LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
discourse_db        |  WHERE a.attrelid = '"discourse_voting_category_settings"'::regclass
discourse_db        |    AND a.attnum > 0 AND NOT a.attisdropped
discourse_db        |  ORDER BY a.attnum
discourse_db        | 
discourse           | Completed 500 Internal Server Error in 30ms (ActiveRecord: 0.0ms | Allocations: 9365)
discourse           | ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "discourse_voting_category_settings" does not exist
discourse           | LINE 8:  WHERE a.attrelid = '"discourse_voting_category_settings"'::...
discourse           |                             ^
discourse           | )
discourse           | /opt/bitnami/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.0.2/lib/patches/db/pg.rb:110:in `exec'
discourse           | Failed to handle exception in exception app middleware : PG::UndefinedTable: ERROR:  relation "discourse_voting_category_settings" does not exist
discourse           | LINE 8:  WHERE a.attrelid = '"discourse_voting_category_settings"'::...
discourse           |                             ^
discourse           | 
discourse           | Started GET "/service-worker-c8000968830b6f6bd33f1e842dffdd569664119d449f93dc7d428d963a71635d.js" for 2.3.75.18 at 2020-10-22 17:37:01 +0000
discourse           | Processing by StaticController#service_worker_asset as */*
discourse           |   Rendering text template
discourse           |   Rendered text template (Duration: 0.0ms | Allocations: 1)
discourse           | Completed 200 OK in 6ms (Views: 0.8ms | ActiveRecord: 0.0ms | Allocations: 1731)

该插件已通过命令行无错误安装:

RAILS_ENV=production bundle exec rake plugin:install[https://github.com/discourse/discourse-voting]
1 个赞

此迁移在某些情况下曾出现过问题。请尝试从控制台运行 bin/rake db:migrate,或重新构建您的容器以解决该问题,直到我们找到修复方案。

4 个赞

@justin,这似乎解决了问题。谢谢。

不过我还是希望你能提供一个修复方案 :smiley:

2 个赞

请按照本指南安装插件:Install plugins on a self-hosted site

此外,正如您在另一个主题中提到的,请遵循 Discourse 官方标准安装 来安装 Discourse。

6 个赞