How do I fix a drop column spelling error?

Running Rails 6 I had a messages table I was no longer using and wanted to remove it. So I ran rails g migration DropMessagesTable

and it appeared to run ok as the messages table disappeared from schema.

I then ran another removal, but of a column only this time: rails g migration RemoveEnd_timeFromAudtions end_time:datetime

and I got this error:

 rails db:migrate
rails aborted!
NameError: uninitialized constant RemoveEndTimeFromAudtions
Did you mean?  RemoveEndTimeFromAuditions
/Users/xxxx/Documents/hosting/rct21/bin/rails:9:in `<top (required)>'
/Users/xxxx/Documents/hosting/rct21/bin/spring:15:in `<top (required)>'

Caused by:
NameError: uninitialized constant RemoveEndTimeFromAudtions
Did you mean?  RemoveEndTimeFromAuditions
/Users/xxxx/Documents/hosting/rct21/bin/rails:9:in `<top (required)>'
/Users/xxxx/Documents/hosting/rct21/bin/spring:15:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

As you can see I misspelled "audition" as "audtions" So I tried rails db:rollback and that did not work.

Any ideas to fix?



Read more here: https://stackoverflow.com/questions/68492823/how-do-i-fix-a-drop-column-spelling-error

Content Attribution

This content was originally published by Mark at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: