|
| 1 | +// <copyright> |
| 2 | +// Copyright by the Spark Development Network |
| 3 | +// |
| 4 | +// Licensed under the Rock Community License (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// |
| 8 | +// http://www.rockrms.com/license |
| 9 | +// |
| 10 | +// Unless required by applicable law or agreed to in writing, software |
| 11 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// See the License for the specific language governing permissions and |
| 14 | +// limitations under the License. |
| 15 | +// </copyright> |
| 16 | + |
| 17 | +using System.Collections.Generic; |
| 18 | + |
| 19 | +namespace Rock.Plugin.HotFixes |
| 20 | +{ |
| 21 | + /// <summary> |
| 22 | + /// Plug-in migration |
| 23 | + /// </summary> |
| 24 | + /// <seealso cref="Rock.Plugin.Migration" /> |
| 25 | + [MigrationNumber( 244, "1.17.0" )] |
| 26 | + public class MigrationRollupsForV17_1_1 : Migration |
| 27 | + { |
| 28 | + /// <summary> |
| 29 | + /// Up methods |
| 30 | + /// </summary> |
| 31 | + public override void Up() |
| 32 | + { |
| 33 | + ChopBlocksUp(); |
| 34 | + } |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// |
| 38 | + /// </summary> |
| 39 | + public override void Down() |
| 40 | + { |
| 41 | + } |
| 42 | + |
| 43 | + #region KH: Register block attributes for chop job in v17.1 (18.0.5) |
| 44 | + |
| 45 | + private void ChopBlocksUp() |
| 46 | + { |
| 47 | + RegisterBlockAttributesForChop(); |
| 48 | + ChopBlockTypesv17_1(); |
| 49 | + } |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// Ensure the Entity, BlockType and Block Setting Attribute records exist |
| 53 | + /// before the chop job runs. Any missing attributes would cause the job to fail. |
| 54 | + /// </summary> |
| 55 | + private void RegisterBlockAttributesForChop() |
| 56 | + { |
| 57 | + |
| 58 | + // Add/Update Obsidian Block Entity Type |
| 59 | + // EntityType:Rock.Blocks.Cms.MediaElementDetail |
| 60 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Cms.MediaElementDetail", "Media Element Detail", "Rock.Blocks.Cms.MediaElementDetail, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "6A7052F9-94DF-4244-BBF0-DB688C3ACBBC" ); |
| 61 | + |
| 62 | + // Add/Update Obsidian Block Entity Type |
| 63 | + // EntityType:Rock.Blocks.Communication.CommunicationTemplateDetail |
| 64 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Communication.CommunicationTemplateDetail", "Communication Template Detail", "Rock.Blocks.Communication.CommunicationTemplateDetail, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "017EEC30-BDDA-4159-8249-2852AF4ADCF2" ); |
| 65 | + |
| 66 | + // Add/Update Obsidian Block Entity Type |
| 67 | + // EntityType:Rock.Blocks.Core.PersonFollowingList |
| 68 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Core.PersonFollowingList", "Person Following List", "Rock.Blocks.Core.PersonFollowingList, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "030B944D-66B5-4EDB-AA38-10081E2ACFB6" ); |
| 69 | + |
| 70 | + // Add/Update Obsidian Block Entity Type |
| 71 | + // EntityType:Rock.Blocks.Core.ScheduledJobList |
| 72 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Core.ScheduledJobList", "Scheduled Job List", "Rock.Blocks.Core.ScheduledJobList, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "D72E22CA-040D-4DE9-B2E0-438BA70BA91A" ); |
| 73 | + |
| 74 | + // Add/Update Obsidian Block Entity Type |
| 75 | + // EntityType:Rock.Blocks.Core.ServiceJobDetail |
| 76 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Core.ServiceJobDetail", "Service Job Detail", "Rock.Blocks.Core.ServiceJobDetail, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "B50B6B68-D327-4A73-B2A8-57EF9E151182" ); |
| 77 | + |
| 78 | + // Add/Update Obsidian Block Entity Type |
| 79 | + // EntityType:Rock.Blocks.Tv.AppleTvPageList |
| 80 | + RockMigrationHelper.UpdateEntityType( "Rock.Blocks.Tv.AppleTvPageList", "Apple Tv Page List", "Rock.Blocks.Tv.AppleTvPageList, Rock.Blocks, Version=17.1.1.0, Culture=neutral, PublicKeyToken=null", false, false, "4E89A96E-88A2-4CA4-A86B-B9FFDCACF49F" ); |
| 81 | + |
| 82 | + // Add/Update Obsidian Block Type |
| 83 | + // Name:Apple TV Page List |
| 84 | + // Category:TV > TV Apps |
| 85 | + // EntityType:Rock.Blocks.Tv.AppleTvPageList |
| 86 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Apple TV Page List", "Lists pages for TV apps (Apple or other).", "Rock.Blocks.Tv.AppleTvPageList", "TV > TV Apps", "A759218B-1C72-446C-8994-8559BA72941E" ); |
| 87 | + |
| 88 | + // Add/Update Obsidian Block Type |
| 89 | + // Name:Communication Template Detail |
| 90 | + // Category:Communication |
| 91 | + // EntityType:Rock.Blocks.Communication.CommunicationTemplateDetail |
| 92 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Communication Template Detail", "Used for editing a communication template that can be selected when creating a new communication, SMS, etc. to people.", "Rock.Blocks.Communication.CommunicationTemplateDetail", "Communication", "FBAB4EB2-B180-4A76-9B5B-C75E2255F691" ); |
| 93 | + |
| 94 | + // Add/Update Obsidian Block Type |
| 95 | + // Name:Media Element Detail |
| 96 | + // Category:CMS |
| 97 | + // EntityType:Rock.Blocks.Cms.MediaElementDetail |
| 98 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Media Element Detail", "Displays the details of a particular media element.", "Rock.Blocks.Cms.MediaElementDetail", "CMS", "D481AE29-A6AA-49F4-9DBB-D3FDF0995CA3" ); |
| 99 | + |
| 100 | + // Add/Update Obsidian Block Type |
| 101 | + // Name:Person Following List |
| 102 | + // Category:Follow |
| 103 | + // EntityType:Rock.Blocks.Core.PersonFollowingList |
| 104 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Person Following List", "Block for displaying people that current person follows.", "Rock.Blocks.Core.PersonFollowingList", "Follow", "18FA879F-1466-413B-8623-834D728F677B" ); |
| 105 | + |
| 106 | + // Add/Update Obsidian Block Type |
| 107 | + // Name:Scheduled Job Detail |
| 108 | + // Category:Core |
| 109 | + // EntityType:Rock.Blocks.Core.ServiceJobDetail |
| 110 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Scheduled Job Detail", "Displays the details of a particular service job.", "Rock.Blocks.Core.ServiceJobDetail", "Core", "762F09EA-0A11-4BC7-9A68-13F0E44217C1" ); |
| 111 | + |
| 112 | + // Add/Update Obsidian Block Type |
| 113 | + // Name:Scheduled Job List |
| 114 | + // Category:Core |
| 115 | + // EntityType:Rock.Blocks.Core.ScheduledJobList |
| 116 | + RockMigrationHelper.AddOrUpdateEntityBlockType( "Scheduled Job List", "Lists all scheduled jobs.", "Rock.Blocks.Core.ScheduledJobList", "Core", "9B90F2D1-0C7B-4F08-A808-8BA4C9A70A20" ); |
| 117 | + |
| 118 | + // Attribute for BlockType |
| 119 | + // BlockType: Apple TV Page List |
| 120 | + // Category: TV > TV Apps |
| 121 | + // Attribute: core.CustomActionsConfigs |
| 122 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "A759218B-1C72-446C-8994-8559BA72941E", "9C204CD0-1233-41C5-818A-C5DA439445AA", "core.CustomActionsConfigs", "core.CustomActionsConfigs", "core.CustomActionsConfigs", @"", 0, @"", "887084AE-416A-4389-916A-99466BDEBEAC" ); |
| 123 | + |
| 124 | + // Attribute for BlockType |
| 125 | + // BlockType: Apple TV Page List |
| 126 | + // Category: TV > TV Apps |
| 127 | + // Attribute: core.EnableDefaultWorkflowLauncher |
| 128 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "A759218B-1C72-446C-8994-8559BA72941E", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", @"", 0, @"True", "84D1AB87-B286-47F4-8851-6D25A65EACF2" ); |
| 129 | + |
| 130 | + Sql( "DELETE FROM [dbo].[Attribute] WHERE [Guid] = 'D400AC7B-A227-4768-A8B2-7B403A0CAF17' AND [Key] = 'DetailPage'" ); |
| 131 | + |
| 132 | + // Attribute for BlockType |
| 133 | + // BlockType: Apple TV Page List |
| 134 | + // Category: TV > TV Apps |
| 135 | + // Attribute: Detail Page |
| 136 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "A759218B-1C72-446C-8994-8559BA72941E", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "PageDetail", "Detail Page", @"The page that will show the page details.", 0, @"", "D400AC7B-A227-4768-A8B2-7B403A0CAF17" ); |
| 137 | + |
| 138 | + // Attribute for BlockType |
| 139 | + // BlockType: Communication Template Detail |
| 140 | + // Category: Communication |
| 141 | + // Attribute: Attachment Binary File Type |
| 142 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "FBAB4EB2-B180-4A76-9B5B-C75E2255F691", "09EC7F0D-3505-4090-B010-ABA68CB9B904", "Attachment Binary File Type", "AttachmentBinaryFileType", "Attachment Binary File Type", @"The FileType to use for files that are attached to an sms or email communication", 1, @"10FD7FE8-7187-45CC-A1E7-D9F71BD90E6C", "78CC588D-D5DA-4FAD-AEDF-E37719454320" ); |
| 143 | + |
| 144 | + // Attribute for BlockType |
| 145 | + // BlockType: Communication Template Detail |
| 146 | + // Category: Communication |
| 147 | + // Attribute: Personal Templates View |
| 148 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "FBAB4EB2-B180-4A76-9B5B-C75E2255F691", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Personal Templates View", "PersonalTemplatesView", "Personal Templates View", @"Is this block being used to display personal templates (only templates that current user is allowed to edit)?", 0, @"False", "655D88DE-04B8-49F6-B994-7F16E4B88E4E" ); |
| 149 | + |
| 150 | + // Attribute for BlockType |
| 151 | + // BlockType: Person Following List |
| 152 | + // Category: Follow |
| 153 | + // Attribute: core.CustomActionsConfigs |
| 154 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "18FA879F-1466-413B-8623-834D728F677B", "9C204CD0-1233-41C5-818A-C5DA439445AA", "core.CustomActionsConfigs", "core.CustomActionsConfigs", "core.CustomActionsConfigs", @"", 0, @"", "60AAFCAC-553B-430D-9F33-1B5BBF214F3D" ); |
| 155 | + |
| 156 | + // Attribute for BlockType |
| 157 | + // BlockType: Person Following List |
| 158 | + // Category: Follow |
| 159 | + // Attribute: core.EnableDefaultWorkflowLauncher |
| 160 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "18FA879F-1466-413B-8623-834D728F677B", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", @"", 0, @"True", "FF99A423-17FC-4430-A968-7FF8AE755D41" ); |
| 161 | + |
| 162 | + // Attribute for BlockType |
| 163 | + // BlockType: Scheduled Job List |
| 164 | + // Category: Core |
| 165 | + // Attribute: core.CustomActionsConfigs |
| 166 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "9B90F2D1-0C7B-4F08-A808-8BA4C9A70A20", "9C204CD0-1233-41C5-818A-C5DA439445AA", "core.CustomActionsConfigs", "core.CustomActionsConfigs", "core.CustomActionsConfigs", @"", 0, @"", "C6B47E32-CA90-4F7B-83D1-E163BE89AB02" ); |
| 167 | + |
| 168 | + // Attribute for BlockType |
| 169 | + // BlockType: Scheduled Job List |
| 170 | + // Category: Core |
| 171 | + // Attribute: core.EnableDefaultWorkflowLauncher |
| 172 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "9B90F2D1-0C7B-4F08-A808-8BA4C9A70A20", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", "core.EnableDefaultWorkflowLauncher", @"", 0, @"True", "DA72C7D5-B0CC-4147-828A-5DF79F88D621" ); |
| 173 | + |
| 174 | + // Attribute for BlockType |
| 175 | + // BlockType: Scheduled Job List |
| 176 | + // Category: Core |
| 177 | + // Attribute: Detail Page |
| 178 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "9B90F2D1-0C7B-4F08-A808-8BA4C9A70A20", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "DetailPage", "Detail Page", @"The page that will show the service job details.", 0, @"", "DF2A7B20-54DA-44DA-A3BE-695CCCCAD6B6" ); |
| 179 | + |
| 180 | + // Attribute for BlockType |
| 181 | + // BlockType: Scheduled Job List |
| 182 | + // Category: Core |
| 183 | + // Attribute: History Page |
| 184 | + RockMigrationHelper.AddOrUpdateBlockTypeAttribute( "9B90F2D1-0C7B-4F08-A808-8BA4C9A70A20", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "History Page", "HistoryPage", "History Page", @"The page to display group history.", 0, @"", "B45EC31E-A1DF-41EE-B2C3-201A8A3C9BF9" ); |
| 185 | + } |
| 186 | + |
| 187 | + private void ChopBlockTypesv17_1() |
| 188 | + { |
| 189 | + RockMigrationHelper.ReplaceWebformsWithObsidianBlockMigration( |
| 190 | + "Chop Block Types 17.1 (18.0.5)", |
| 191 | + blockTypeReplacements: new Dictionary<string, string> { |
| 192 | + // blocks chopped in v17.1 (Pre-Alpha: 18.0.5) |
| 193 | +{ "6D3F924E-BDD0-4C78-981E-B698351E75AD", "9b90f2d1-0c7b-4f08-a808-8ba4c9a70a20" }, // Scheduled Job List ( Core ) |
| 194 | +{ "7BD1B79C-BF27-42C6-8359-F80EC7FEE397", "a759218b-1c72-446c-8994-8559ba72941e" }, // Apple TV Page List ( TV > TV Apps ) |
| 195 | +{ "881DC0D1-FF98-4A5E-827F-49DD5CD0BD32", "d481ae29-a6aa-49f4-9dbb-d3fdf0995ca3" }, // Media Element Detail ( CMS ) |
| 196 | +{ "BD548744-DC6D-4870-9FED-BB9EA24E709B", "18fa879f-1466-413b-8623-834d728f677b" }, // Person Following List ( Follow ) |
| 197 | +{ "BFDCA2E2-DAA1-4FA6-B33C-C53C7CF23C5D", "FBAB4EB2-B180-4A76-9B5B-C75E2255F691" }, // Communication Template Detail ( Communication ) |
| 198 | +{ "C5EC90C9-26C4-493A-84AC-4B5DEF9EA472", "762f09ea-0a11-4bc7-9a68-13f0e44217c1" }, // Scheduled Job Detail ( Core ) |
| 199 | + // blocks chopped in v17.1 (Pre-Alpha: 18.0.4) |
| 200 | +{ "00A86827-1E0C-4F47-8A6F-82581FA75CED", "1fde6d4f-390a-4ff6-ad42-668ec8cc62c4" }, // Assessment Type List ( CRM ) |
| 201 | +{ "069554B7-983E-4653-9A28-BA39659C6D63", "47f619c2-f66d-45ec-adbb-22ca23b4f3ad" }, // Attribute Matrix Template List ( Core ) |
| 202 | +{ "32183AD6-01CB-4533-858B-1BDA5120AAD5", "7686a42f-a2c4-4c15-9331-8b364f24bd0f" }, // Device List ( Core ) |
| 203 | +{ "32E89BAE-C085-40B3-B872-B62E25A62BDB", "0f99866a-7fab-462d-96eb-9f9534322c57" }, // Gateway List ( Finance ) |
| 204 | +{ "50ADE904-BB5C-40F9-A97D-ED8FF530B5A6", "cfbb4daf-1aeb-4095-8098-e3a82e30fa7e" }, // Persisted Dataset List ( CMS ) |
| 205 | +{ "65057F07-85D5-4795-91A1-86D8F67A65DC", "2eaf9e5a-f47d-4c58-9aa4-2d340547a35f" }, // Financial Statement Template List ( Finance ) |
| 206 | +{ "A580027F-56DB-43B0-AAD6-7C2B8A952012", "29227fc7-8f24-44b1-a0fb-e6a8694f1c3b" }, // Content Channel Type List ( CMS ) |
| 207 | +{ "C4FBF612-C1F6-428B-97FD-8AB0B8EA31FC", "40b6af94-5ffc-4ee3-add9-c76818992274" }, // Rest Key List ( Security ) |
| 208 | +{ "C6DFE5AE-8C4C-49AD-8EC9-11CE03146F53", "0acf764f-5f60-4985-9d10-029cb042da0d" }, // Tag List ( Core ) |
| 209 | +{ "D8CCD577-2200-44C5-9073-FD16F174D364", "559978d5-a392-4bd1-8e04-055c2833f347" }, // Badge List ( CRM ) |
| 210 | + }, |
| 211 | + migrationStrategy: "Chop", |
| 212 | + jobGuid: SystemGuid.ServiceJob.DATA_MIGRATIONS_171_CHOP_OBSIDIAN_BLOCKS, |
| 213 | + blockAttributeKeysToIgnore: new Dictionary<string, string> { } ); |
| 214 | + } |
| 215 | + |
| 216 | + #endregion |
| 217 | + } |
| 218 | +} |
0 commit comments