SQLite3::SQLException:迁移时列名重复 [英] SQLite3::SQLException: duplicate column name while migrating

查看:67
本文介绍了SQLite3::SQLException:迁移时列名重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在关注 Ruby on Rails 教程,我在 https://www.railstutorial.org/book/updating_and_deleting_users#sec-administrative_users 每次我运行 bundle exec rake db:migrate 时,我都会收到以下错误:

I am currently following the Ruby on Rails Tutorial and I am at https://www.railstutorial.org/book/updating_and_deleting_users#sec-administrative_users Every time I run bundle exec rake db:migrate I get the following error:

SQLite3::SQLException: duplicate column name: remember_digest: ALTER TABLE "users" ADD   "remember_digest" varchar/home/mclacs14/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `initialize'

推荐答案

尝试将您的数据库迁移到 version=0使用命令:rake db:migrate VERSION=0

try migrating your DB to version=0 with command: rake db:migrate VERSION=0

然后运行rake db:migrate

这篇关于SQLite3::SQLException:迁移时列名重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆