This is Qiita's first post. Thank you.
In rails built in docker environment, when docker-compose exec web rails db: migrate is set, the following error occurs
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Invalid use of NULL value: ALTER TABLE `tasks` CHANGE `name` `name` varchar(255) NOT NULL
....Omitted below
It wasn't completely identified, but it's possible that the previous migration process wasn't working. There was an error around creating the table. I should have fixed the error Mysql ...
Reset the database.
$ docker-compose exec web rails db:migrate:reset
Migrate again
$ docker-compose exec web rails db:migrate
I was able to repair it. For confirmation, I think you should see if the DB surroundings are working correctly from the console.
Recommended Posts