试图在 rails 中将 NAME FIELD 添加到我的 simple_form
已添加 $ rails generate migration AddNameToUsers name:string
已添加到 user.db 文件和我的迁移文件中
class AddNameToUsers < ActiveRecord::Migration
def change
add_column :users, :name, :string
end
end
但是当我运行 rake 时db:migrate
,出现以下错误(也运行 bundle exec ...)
耙中止!发生错误,此迁移和所有后续迁移均已取消:
SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar(255) DEFAULT '' NOT NULL/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `initialize' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `new' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `prepare' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:134:in `execute'
有任何想法吗?