Join Table Migration Error

Hi all,

I have two models in my rails application, Section and User. I have a
has_and_belongs_to_many relationship between both.

After running the migration for creating sections, creating users, and
creating the join table, everything works fine. But if I try to
rollback my database migrations (which I frequently do during
development), I get the following error after the join table is deleted
but before the users table is deleted:

Mysql::Error: Table ‘rails_app_development.sections_users’ doesn’t
exist: SHOW FIELDS FROM sections_users

Is there a way to avoid this error? I’ve tried moving the “drop_table”
command for the join table to an earlier migration, but I still get
errors.

Any help is appreciated.

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