LoginSignup
0
0

More than 3 years have passed since last update.

[カラム重複によるerror]Mysql2::Error: Duplicate column name ''カラム名"

Posted at

概要

ターミナルで「rails db:migrate」を入力した際に起きたerror。インターネットで調べてみるとカラムが重複していることが原因だった。

原因

db/migrateを調べるとemailカラムが重複していた

qiita.rb
t.string :email,              null: false, default: ""
t.string :email,              null: false, default: ""

改善方法

rails db:rollbackでマイグレーションファイルをdownさせる

→重複している内容を削除し、データを1つにする

→rails db:migrateする。以上のことでerrorが改善された。

0
0
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
0
0