我在生产服务器上运行了sevreal迁移(添加表订阅,将表重命名为Order to Order),但后来我遇到了问题。 我不知道如何解决这个问题。这是我在rails console中的错误消息:
ActiveRecord::StatementInvalid: PG::Error: ERROR: relation "subscriptions" does not exist
LINE 5: WHERE a.attrelid = '"subscriptions"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"subscriptions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
编辑:我已经做了rake db:migrate 编辑2:https://gist.github.com/anonymous/0963ec46f079699a56a0(这里是我的schema.rb) 编辑3:我的应用程序是Alwaysdata的主机,我已经重启了
答案 0 :(得分:2)
我发现解决方案很糟糕:
RAILS_ENV=production rake db:migrate