Avoiding migration problems with plugins using acts-as-taggable-on

Added by Harry Garrood over 4 years ago

Say you want to install two Redmine plugins which both use the acts-as-taggable-on gem. Unfortunately, they will both try to create the same two tables in the database: "tags", and "taggings".

Plugin developers can use a number of workarounds:

  • Ask users to do rails g acts_as_taggable_on:migration && rake db:migrate -- but then, doing rake redmine:plugins:migrate NAME=foo VERSION=0 won't drop the tables when they uninstall it.
  • Do rails g acts_as_taggable_on:migration during development and check the resultant file in -- but then, uninstalling the plugin when other plugins are still using those tables will delete their data!

I don't like compromises, so I've come up with a better solution. It's at https://github.com/hdgarrood/redmine_acts_as_taggable_on (there's a more detailed introduction over there), and it's super easy to set up.

It will work best if as many plugins as possible use it. So, Redmine plugin developers, I implore you: Please update your plugins to use this gem!

:)