rails db:migrateができない
rails db:migrate
をしたところ、エラーが出てしまいました。
どうすればいいでしょうか?
教えてください。
== 20180629092541 AddActivationToUsers: migrating =============================
-- add_column(:users, :activation_digest, :string)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: duplicate column name: activation_digest: ALTER TABLE "users" ADD "activation_digest" varchar
C:/Users/sk/programming/sample_app/db/migrate/20180629092541_add_activation_to_users.rb:3:in change'
bin/rails:4:in require'
bin/rails:4:in `<main>'
Caused by: ActiveRecord::StatementInvalid: SQLite3::SQLException: duplicate column name: activation_digest: ALTER TABLE "users" ADD "activation_digest" varchar C:/Users/sk/programming/sample_app/db/migrate/20180629092541_add_activation_to_users.rb:3:in change'
bin/rails:4:in require' bin/rails:4:in `<main>'
Caused by:
SQLite3::SQLException: duplicate column name: activation_digest
C:/Users/sk/programming/sample_app/db/migrate/20180629092541_add_activation_to_users.rb:3:in change'
bin/rails:4:in require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
C:/Users/sk/programming/sample_app/db/migrate/20180629092541_add_activation_to_users.rb のコード
class AddActivationToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :activation_digest, :string
add_column :users, :activated, :boolean, default: false
add_column :users, :activated_at, :datetime
end
end