使用sqlite3删除ruby rails中的表行时遇到问题

时间:2015-03-22 16:01:32

标签: ruby-on-rails sqlite database-migration

尝试按命令删除表行

rails g migration RemoveSource_AccountFromPosts source_account:multiset

创建迁移:

class RemoveSourceAccountFromPosts < ActiveRecord::Migration
  def change
    remove_column :posts, :source_account, :multiset
  end
end

但是当我耙,我得到这个错误

-- remove_column(:posts, :source_account, :multiset)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `to_sym' for nil:NilClassC:/Sites/jeepjig/db/migrate/20150322155456_remove_source_account_from_posts
.rb:3:in `change'
C:in `migrate'
NoMethodError: undefined method `to_sym' for nil:NilClass

0 个答案:

没有答案