Table does not exist error in rails console

I recently renamed a schema named favourites using rails g migration rename_favourites_to_favourite_cocktails In the migration file generated I did this
`def self.up
rename_table :favourites, :favouriteCocktails
end

def self.down
rename_table :favouriteCocktails, :favourites
end then I ranrails db:migrate. At the rails console I decide to checkout if the table still behaves like normal by typing FavouriteCocktailbut I got this error thatFavouriteCocktail(Table doesn’t exist)` I have dropped the database, created and did rails db:shema:load but it still does not work. I have also made neccessary name changes to the model and controlers but no success. I need help on how to solve this problem.

Try rails db:migrate

Normally you’d use snake_case to name tables rather than camelCase. Rails may be looking for the wrong table name.

You can also specify table_name 'favouriteCocktails' in your model class to override Rails’ default assumption.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs