Rails迁移停止&挂起

时间:2014-04-09 11:56:30

标签: ruby-on-rails postgresql rake rails-migrations

我有以下迁移:

class AddHyphenatedNameToMenus < ActiveRecord::Migration
  def up
    add_column :menus, :hyphenated_name, :string, null: false, required: true
  end

  def down
    remove_column :menus, :hyphenated_name
  end
end

导轨迁移会神秘地停止并挂起。

$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
==  AddHyphenatedNameToMenus: migrating =======================================
-- add_column(:menus, :hyphenated_name, :string, {:null=>false, :required=>true})

按下&c; ctrl + c&#39;我得到以下错误跟踪:

undefined method `result' for Interrupt:Interrupt/home/.rvm/gems/ruby-1.9.3-p194@abc/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1147:in `translate_exception'

我无法找到相同的原因。任何帮助将非常感激。感谢。

0 个答案:

没有答案