XF 2.0 Best way to add additional columns to fields for add-ons

Jake B.

Well-known member
For Reactions I'm adding in support for XFRM and XFMG, but curious if there is a way built into XenForo that I haven't found yet that will add the columns into these tables if someone were to install XFRM or XFMG after installing Reactions. Otherwise, I suppose I can just add in a route that will run the relevant setup steps manually, but if there was a way to handle this automatically that'd be pretty helpful :)
 
I'd probably consider adding an option that determines whether this functionality is enabled in whatever add-on. On installation, you can detect if specific add-ons are installed and enable that option automatically. Whenever the option is enabled, it would then check whether the necessary columns exist and add them if necessary. (Disabling the option would just disable the extra functionality.)

The only case this wouldn't handle is an uninstall and reinstall of the target add-on, though that should be rather rare and could probably be targeted if needed.
 
Back
Top Bottom