I didn't notice it when developing in the local environment, but I had various problems when deploying heroku, so I will write it as a memorandum.
I got this error and couldn't migrate.
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
you can't define an already defined column 'name'.
Reset the database once and re-migrate.
$ rails db:migrate:reset
And again my great
$ rails db:migrate
Then, I got this error.
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedColumn: ERROR: column "user_id" of relation "scores" does not exist
I am migrating in the order of the time stamps, but I got an error at a certain migrating file. There were various problems, but the big problem was that there was a migration file that tried to reomove a column that did not exist. I deleted it and ran the migration again and it worked fine.
Recommended Posts