【问题标题】:heroku migration failsheroku 迁移失败
【发布时间】:2012-11-09 14:37:51
【问题描述】:

在 heroku 中我运行 rake db:migrate 并得到以下错误

==  AlterBodyForDocuments: migrating ==========================================
-- change_column(:documents, :body, :mediumtext)
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR:  type "mediumtext" does not exist
: ALTER TABLE "documents" ALTER COLUMN "body" TYPE mediumtext

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

这是我的 AlterBodyForDocuments 迁移:

class AlterBodyForDocuments < ActiveRecord::Migration
  def change
    change_column :documents, :body, :mediumtext
  end
end

【问题讨论】:

    标签: ruby-on-rails heroku rails-migrations


    【解决方案1】:

    我认为mediumtext是mysql的东西

    heroku 使用 postgresql

    改用:text

    【讨论】:

      猜你喜欢
      • 2015-01-13
      • 2011-06-29
      • 2011-08-05
      • 1970-01-01
      • 2015-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多