We are developing a CMS for multiple sites. Sometimes we need to handle changing type names of Content Items. With multiple sites and multiple environments, this take a long time to do manually. In production you would turn of the FixClass.aspx page so it has be be something more automatically.
The way we have handled it is to make a IPluginInitializer with AutoInitialize, that handles the upgrade which will get a connection to the database and run a couple of queries to the database.
public class DiscriminatorUpgradeInitializer : IPluginInitializer
public void Initialize(IEngine engine)
var handler = engine.Resolve<IDiscriminatorUpgradeHandler>();
This works, although much of the code in the implementation of IDiscriminatorUpgradeHandler is copied and refactored from FixClass.aspx.cs. It would be great if this functionality could be provided from N2, because then it's much easier for us and others to automate that process.
Also, InstallationManager is also hard to mock since it doesn't have virtual properties/methods or implementing an interface. The only this from it that we needed in this case is the GetConnection and GetCommand. So I would also suggest to refactor those two methods into an interface.
If you think this is a good idea, I'm happy to provide some more code on what we have done.