LoginSignup
4
6

More than 5 years have passed since last update.

SQLite3::SQLException: duplicate column name のエラー

Posted at

ruby on rails
で画像投稿を実装中、
$ rails g migration add_image_to_users image:string
と入力して、上手くいかないので、何度か実験していたら、
bundle exec rake db:migrate
を入力したところ、

SQLite3::SQLException: duplicate column name image

というエラーが発生
テーブルには、imageカラムは既にあるから、エラーが出たみたいな感じ。

解決した方法
bundle exec rake db:reset
でデータを一度消してから、
bundle exec rake db:migrate
で成功。

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6