Uninstalling a plugin on multisite

This is quite an edge case, might be a bug, and I am curious if there is a good solution for this.
@sam I’m tagging you because if anyone should know, I it’s probably you.

Consider a multisite installation.

  1. Forum A is added to the multisite
  2. A plugin that modifies the database is installed (for instance the chat plugin which adds chat_enabled to user_options)
  3. Migrations are run and columns are added to some tables on forum A
  4. The plugin is removed, columns will remain
  5. Forum B is added to the multisite
  6. We now have forum A and forum B on a single multisite with different column definitions in user_options
  7. multisite:seed_fu runs into problems (I think because of ActiveRecord model caching?)
#<ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column user_options.chat_enabled does not exist
LINE 1: ...lendar", "user_options"."oldest_search_log_date", "user_opti...
3 Likes

I’m pretty sure I also ran into this problem when I recently tried to add a new site to a multisite. Thank you for articulating it.

1 Like

Yeah this is a bit of a nightmare, you are going to need to run cleanup by hand here.

It is critical to have schema parity in all multisite setups.