rails db:migrate RAILS_ENV=test をしようとしたのですがエラーが出てきてできません。解決方法を教えてください。
PS C:\Users\sk\programming\portfolio\study_app> rails db:migrate RAILS_ENV=test
== 20180917193206 AddPictureToUsers: migrating ================================
-- add_column(:users, :picture, :string)
-> 0.0018s
== 20180917193206 AddPictureToUsers: migrated (0.0023s) =======================
== 20180917203547 RemovePictureFromUsers: migrating ===========================
-- remove_column(:users, :picture, :string)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::ConstraintException: FOREIGN KEY constraint failed: DROP TABLE "users"
C:/Users/sk/programming/portfolio/study_app/db/migrate/20180917203547_remove_picture_from_users.rb:3:in change' bin/rails:4:in
require'
bin/rails:4:in `<main>'
Caused by:
ActiveRecord::InvalidForeignKey: SQLite3::ConstraintException: FOREIGN KEY constraint failed: DROP TABLE "users"
C:/Users/sk/programming/portfolio/study_app/db/migrate/20180917203547_remove_picture_from_users.rb:3:in change' bin/rails:4:in
require'
bin/rails:4:in `<main>'
Caused by:
SQLite3::ConstraintException: FOREIGN KEY constraint failed
C:/Users/sk/programming/portfolio/study_app/db/migrate/20180917203547_remove_picture_from_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)

回答1件
あなたの回答
tips
プレビュー