Migrations that need to go into a hotfix branch are done as plugin hotfix migrations. These migrations are located in Rock.Plugin.HotFixes. When a plug-in hotfix migration is done, an EF migration in the Rock.Migrations project must also be created. If a plug-in migration is created and it is not practical to create an EF migration at the same time then add the migration to the Asana “Migration Rollups” project for the develop branch. Make a note in the task that the migration is in a hotfix migration and needs to be included in the EF migrations. Each logical group of data changes should have it's own method which is then called in the Up() method. For plugin migrations the method name should follow the template P<###>_<BriefTopicDescription>(). Example: P777_UpdateDataToLatestStandard(). The method should be documented with an appropriate summary that starts with the developer's Initials. When the hotfix branch is merged to develop the plug-in migrations are also merged. We do not want hotfix migrations to run in the develop branch so the code in the Up() method must be commented out. The code generator has an option called Disable Hotfix Migrations. If checked the code generator will sweep through the plugin migrations and rename the Up() method to OldUp() and then create a new empty Up() method, accomplishing the same end. This should only be done on the develop branch or the branch holding the migration token. Running the code generator is part of the pre-alpha build process, so this done at least every two weeks. However, this should be run by the developer every time there is a model change. In develop all migrations are EF migrations. This is needed to maintain the sequence in which the migrations are applied. This is what a plugin migration should look like in a hotfix branch: [MigrationNumber( 777, "1.15.0" )] public class MigrationRollupsFor15_4_0 : Migration { /// <summary> /// Operations to be performed during the upgrade process. /// </summary> public override void Up() { P777_UpdateDataToLatestStandard(); P777_CorrectTheIncorrect(); P777_UpdateToWhom(); } /// <summary> /// Operations to be performed during the downgrade process. /// </summary> public override void Down() { // Down migrations are not yet supported in plug-in migrations. } /// <summary> /// ED: Update this to that /// </summary> private void P777_UpdateDataToLatestStandard() { // Cool stuff here... } } This is what it should look like in develop after running the code generator. Note it is okay to just comment out the method calls in the Up() directory instead of running the code generator. [MigrationNumber( 777, "1.15.0" )] public class MigrationRollupsFor15_4_0 : Migration { /// <summary> /// Operations to be performed during the upgrade process. /// </summary> public override void Up() { //---------------------------------------------------------------------------------- // <auto-generated> // This Up() migration method was generated by the Rock.CodeGeneration project. // The purpose is to prevent hotfix migrations from running when they are not // needed. The migrations in this file are run by an EF migration instead. // </auto-generated> //---------------------------------------------------------------------------------- } private void OldUp() { P777_UpdateDataToLatestStandard(); P777_CorrectTheIncorrect(); P777_UpdateToWhom(); } /// <summary> /// Operations to be performed during the downgrade process. /// </summary> public override void Down() { // Down migrations are not yet supported in plug-in migrations. } /// <summary> /// ED: Update this to that /// </summary> private void P777_UpdateDataToLatestStandard() { // cool stuff here... } ... }