This is the first post.
PremiseCurrently, I am creating a question app on rails.
I decided to implement a feature that allows me to bookmark questions.
First I wanted to create a model and created a "like" model, but I didn't like the table name "likes" so I tried to delete it. However, because I was ignorant, I thought that if I deleted the model as it was, the table would also be deleted, but only the model disappeared and only the table remained.
So, referring to the following article, I created a migration file called 20201105xxxxxx_drop_likes.rb to delete the remaining likes table, and I succeeded in deleting the table.
https://qiita.com/miyahkun/items/1215e54c86e80e4b5324
After that, I recreated the bookmark function, ran the test in the local environment, confirmed it, and deployed it.
When deploying, the following message occurred.
StandardError: An error has occurred, all later migrations canceled:
Mysql2 :: Error: Unknown table'likes'
Corresponding source code (20201105xxxxxx_drop_likes.rb)
class DropLikes
What I tried
After doing heroku run rails db: reset
I ran heroku run rails db: migrate again,
I got similar results.
MacOS Catalina
ruby 2.6.5p114
Rails 6.0.3.4
heroku 7.47.0
We apologize for the inconvenience, but thanks for your response.
Please point out any incomplete information.
-
Answer # 1
Related articles
- ruby on rails - [docker] mysql2 :: error :: connectionerror: unknown mysql server host'db' (-2)
- ruby - i want to resolve mysql2 :: error :: connectionerror (unknown mysql server host'db' (0)): that occurred while deploying t
- ruby - i got "mysql2 :: error :: connectionerror: plugin caching_sha2_password could not be loaded "
- ruby on rails - unknown action error when trying to post a comment
- ruby - mysql2 :: error: table'gym_app_developmentmenus' doesn't exist
- ruby - mysql2 :: error: field'tag_name' doesn't have a default value
- ruby - many-to-many post tag search mysql2 :: error: unknown column i want to solve'poststag_ids' in'where clause'
- ruby - i got a routing error when i sent a comment
- ruby on rails - i get an error without being created
- ruby on rails 6 - when i press new user registration, i get an error of no route matches [get] "/ users"
- ruby - i entered secret_key_base, but http error 500 cannot be resolved
- ruby - i want to resolve an error when installing gem byebug
- ruby on rails - error when implementing rails6 follow function
- ruby - i get an error with a single test code for a model
- ruby on rails uninitialized constant error
- ruby on rails - i want to avoid displaying duplicate data for each shop
- ruby - validation error when saving intermediate table
- ruby - http error 500 error occurred in aws deployment, but the cause cannot be determined
- ruby error code
It wasn't the ultimate solution, but it was avoided.
For this error avoidance method, I decided to continue implementing it by giving a completely different application name to a completely different database using the code until just before the error appeared on GitHub.
Thank you very much.