Ejemplo n.º 1
0
 public override void Up()
 {
     RockMigrationHelper.AddDefinedType("Check-in",
                                        "Attendance Qualifiers", "Used to note special properties of an attendance record, such as mobile or with parent.",
                                        Constants.DEFINED_TYPE_ATTENDANCE_QUALIFIERS);
     RockMigrationHelper.AddDefinedValue(Constants.DEFINED_TYPE_ATTENDANCE_QUALIFIERS, "Mobile Check-in - Set Did Attend",
                                         "Qualifies an attendance that it is a mobile check-in and SHOULD be marked DidAtted when scanned.", Constants.DEFINED_VALUE_MOBILE_DID_ATTEND);
     RockMigrationHelper.AddDefinedValue(Constants.DEFINED_TYPE_ATTENDANCE_QUALIFIERS, "Mobile Check-in - Set Did NOT Attend",
                                         "Qualifies an attendance that it is a mobile check-in and should NOT be marked DidAtted when scanned.", Constants.DEFINED_VALUE_MOBILE_NOT_ATTEND);
     RockMigrationHelper.AddDefinedValue(Constants.DEFINED_TYPE_ATTENDANCE_QUALIFIERS, "Attendance Status - With Parent",
                                         "Qualifies an attendance that a child has temporarily left the class room with a parent and is expected to return.", Constants.DEFINED_VALUE_ATTENDANCE_STATUS_WITH_PARENT);
 }
Ejemplo n.º 2
0
 public override void Up()
 {
     RockMigrationHelper.AddDefinedType("Check-in",
                                        "Nested Campuses", "Describes campuses that are nested within other campuses so that attendance and mobile check-in can work correctly.",
                                        Constants.DEFINED_TYPE_NESTED_CAMPUSES);
     RockMigrationHelper.AddDefinedTypeAttribute(Constants.DEFINED_TYPE_NESTED_CAMPUSES, Rock.SystemGuid.FieldType.CAMPUS,
                                                 "Parent Campus", Constants.DEFINED_VALUE_ATTRIBUTE_PARENT_CAMPUS, "The check-in campus must match this for the process to be applied.", 0, true, "",
                                                 false, true, "CE0BF4A2-2837-4A60-8FC9-417199507546");
     RockMigrationHelper.AddDefinedTypeAttribute(Constants.DEFINED_TYPE_NESTED_CAMPUSES, Rock.SystemGuid.FieldType.CAMPUS,
                                                 "Child Campus", Constants.DEFINED_VALUE_ATTRIBUTE_CHILD_CAMPUS, "The family campus must match this for the process to be applied.", 0, true, "",
                                                 false, true, "9CDBFA64-63D0-40FE-93DD-09EA78E7BFB0");
 }
Ejemplo n.º 3
0
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Global", "Star Values", "Star values for events", "048C200E-2B8E-4501-8C9B-A87C870C3C0D");
            RockMigrationHelper.AddDefinedValue("048C200E-2B8E-4501-8C9B-A87C870C3C0D", "Check-in", "", "DEE129DE-9516-43C2-AEBB-F510C603007E", false);
            RockMigrationHelper.AddDefinedValue("048C200E-2B8E-4501-8C9B-A87C870C3C0D", "First Time Friend", "", "EEBECE35-7C24-47CD-8340-7CB0BB33C528", false);
            RockMigrationHelper.AddDefinedValue("048C200E-2B8E-4501-8C9B-A87C870C3C0D", "Memory Verse", "", "DF75BB6F-FE37-4CB3-BD13-12B4F2D2D033", false);
            RockMigrationHelper.AddDefinedValue("048C200E-2B8E-4501-8C9B-A87C870C3C0D", "Special Event Attendance", "", "363504F2-F55F-4E0A-923C-6A25275FC34F", false);

            RockMigrationHelper.AddEntityAttribute("Rock.Model.DefinedValue", "C757A554-3009-4214-B05D-CEA2B2EA6B8F", "DefinedTypeId", "76", "Star Value", "", "Number of Stars this event is worth", 1, "", "6A1A06FE-27AA-4D16-9F69-28FDEEAFA54A", "StarValue");
            RockMigrationHelper.AddDefinedValueAttributeValue("DEE129DE-9516-43C2-AEBB-F510C603007E", "6A1A06FE-27AA-4D16-9F69-28FDEEAFA54A", "5");
            RockMigrationHelper.AddDefinedValueAttributeValue("EEBECE35-7C24-47CD-8340-7CB0BB33C528", "6A1A06FE-27AA-4D16-9F69-28FDEEAFA54A", "5");
            RockMigrationHelper.AddDefinedValueAttributeValue("DF75BB6F-FE37-4CB3-BD13-12B4F2D2D033", "6A1A06FE-27AA-4D16-9F69-28FDEEAFA54A", "5");
            RockMigrationHelper.AddDefinedValueAttributeValue("363504F2-F55F-4E0A-923C-6A25275FC34F", "6A1A06FE-27AA-4D16-9F69-28FDEEAFA54A", "5");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.UpdateCategory("6028D502-79F4-4A74-9323-525E90F900C7", "CMS Settings", string.Empty, string.Empty, "262313F6-5D66-41CE-9B6F-D36567D9AB9D", 1);

            string cacheTagDefineTypeDesc = @"Cached tags are used to link cached content so that it can be expired as a group. The Defined Value''s value is the key for the cache tag and should not be updated without refreshing the entire Rock cache. Changing tag keys can also break custom Lava that is using the key values.";

            RockMigrationHelper.AddDefinedType("CMS Settings", "Cache Tags", cacheTagDefineTypeDesc, "BDF73089-9154-40C1-90E4-74518E9937DC", cacheTagDefineTypeDesc);

            // Page: CacheManager
            RockMigrationHelper.AddPage(true, "B4A24AB7-9369-4055-883F-4F4892C39AE3", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Cache Manager", "", "4B8691C7-537F-4B6E-9ED1-E3BA3FA0051E", "fa fa-tachometer-alt");   // Site:Rock RMS
            RockMigrationHelper.AddPageRoute("4B8691C7-537F-4B6E-9ED1-E3BA3FA0051E", "cachemanager");
            RockMigrationHelper.UpdateBlockType("Cache Manager", "Block used to view cache statistics and clear the existing cache.", "~/Blocks/Cms/CacheManager.ascx", "CMS", "48AD1B85-C51C-4C51-A902-E2DC4586B903");
            // Add Block to Page: CacheManager, Site: Rock RMS
            RockMigrationHelper.AddBlock(true, "4B8691C7-537F-4B6E-9ED1-E3BA3FA0051E", "", "48AD1B85-C51C-4C51-A902-E2DC4586B903", "Cache Manager", "Main", "", "", 0, "C7107FFF-DE8D-41DD-B5EA-9C9C80B98C3C");
        }
Ejemplo n.º 5
0
 public override void Up()
 {
     RockMigrationHelper.AddDefinedType("", "Html To Image", "Templates for creating images from Html and Lava", "8CC5A105-E6B9-4F63-89E0-A83F81ACBB21");
     RockMigrationHelper.AddDefinedTypeAttribute("8CC5A105-E6B9-4F63-89E0-A83F81ACBB21", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Template", "Template", "", 0, "", "A247948E-AF88-4622-996D-DBE69CE41832");
     RockMigrationHelper.AddDefinedTypeAttribute("8CC5A105-E6B9-4F63-89E0-A83F81ACBB21", "4BD9088F-5CC6-89B1-45FC-A2AAFFC7CC0D", "Enabled Lava Commands", "EnabledLavaCommands", "", 1, "", "40286BE2-F841-423C-B920-78D827C65B81");
     RockMigrationHelper.AddDefinedTypeAttribute("8CC5A105-E6B9-4F63-89E0-A83F81ACBB21", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Image Type", "ImageType", "", 2, "", "3735CF5F-405A-4914-9880-9CC64343CD11");
     RockMigrationHelper.AddDefinedTypeAttribute("8CC5A105-E6B9-4F63-89E0-A83F81ACBB21", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Height", "Height", "", 4, "", "D7759B7A-7D4B-4370-A665-18396F7D6768");
     RockMigrationHelper.AddDefinedTypeAttribute("8CC5A105-E6B9-4F63-89E0-A83F81ACBB21", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Width", "Width", "", 3, "", "9191028F-A80B-4D1A-B8B8-3B11E4DFDAD5");
     RockMigrationHelper.AddAttributeQualifier("3735CF5F-405A-4914-9880-9CC64343CD11", "fieldtype", "ddl", "27978DCD-6C83-4E5C-96CD-32DA5EDDF2F5");
     RockMigrationHelper.AddAttributeQualifier("3735CF5F-405A-4914-9880-9CC64343CD11", "repeatColumns", "", "50FF293A-53FB-4BE6-8F84-C6C4F4D118FE");
     RockMigrationHelper.AddAttributeQualifier("3735CF5F-405A-4914-9880-9CC64343CD11", "values", "png,jpg", "5BA047C2-B988-492B-8F46-D48FCF5EBDFE");
     RockMigrationHelper.AddAttributeQualifier("40286BE2-F841-423C-B920-78D827C65B81", "repeatColumns", "", "0BC7C7E7-5DE6-485D-97F4-6C630D337A81");
     RockMigrationHelper.AddAttributeQualifier("A247948E-AF88-4622-996D-DBE69CE41832", "editorHeight", "400", "CE4187E7-D83F-4BAF-8EBC-A1124474959B");
     RockMigrationHelper.AddAttributeQualifier("A247948E-AF88-4622-996D-DBE69CE41832", "editorMode", "3", "354730E0-C67A-4686-817F-11FE82A34AE0");
     RockMigrationHelper.AddAttributeQualifier("A247948E-AF88-4622-996D-DBE69CE41832", "editorTheme", "0", "FC2F6D93-69AC-4616-BF97-2CD3F6FAF856");
 }
Ejemplo n.º 6
0
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType(
                "Group",
                "Sport",
                "Sports that originated from LeagueApps.",
                "3fc2b68b-9a24-46e9-b6d9-6c77b98abfb3"
                );

            RockMigrationHelper.AddDefinedType(
                "Group",
                "Season",
                "Seasons that originated from LeagueApps.",
                "cb85b2aa-46e6-4655-802c-4fe33379018d"
                );
        }
        public override void Up()
        {
            // Make sure this is unique
            if (DefinedTypeCache.Read(new Guid("0913F7A9-A2BF-479C-96EC-6CDB56310A83")) == null)
            {
                RockMigrationHelper.AddDefinedType("Global", "Hospitals", "Hospital List", "0913F7A9-A2BF-479C-96EC-6CDB56310A83", @"");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "City", "Qualifier2", "", 0, "", "CEDC60C1-0F9E-4FE2-BE62-41716813C968");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Notes", "Qualifier8", "", 0, "", "C47A879E-F737-4156-A1FF-B7C465FDB9BC");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Phone", "Qualifier5", "", 0, "", "A4E41679-2CE6-479F-84D4-6821B25E3648");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Speed Dial", "Qualifier6", "", 0, "", "D97EC9DE-5D6A-42FD-B4CE-0516FD5455F6");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "State", "Qualifier3", "", 0, "", "239E507C-7C1B-4B4D-84D4-33C368843F04");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Street Address", "Qualifier1", "", 0, "", "73AC0DCE-CE90-4835-AAE7-E98B08F52E9C");
                RockMigrationHelper.AddDefinedTypeAttribute("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Zip", "Qualifier4", "", 0, "", "46A83E00-D530-48AD-B935-52C015DCA901");
                RockMigrationHelper.AddDefinedValue("0913F7A9-A2BF-479C-96EC-6CDB56310A83", "Sample Hospital", "", "0997ACB6-A4B4-4766-B573-3C44D14DF342", false);
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "239E507C-7C1B-4B4D-84D4-33C368843F04", @"KY");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "46A83E00-D530-48AD-B935-52C015DCA901", @"40023");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "73AC0DCE-CE90-4835-AAE7-E98B08F52E9C", @"1 Main St");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "A4E41679-2CE6-479F-84D4-6821B25E3648", @"(502) 111-1111");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "C47A879E-F737-4156-A1FF-B7C465FDB9BC", @"");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "CEDC60C1-0F9E-4FE2-BE62-41716813C968", @"Louisville");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF342", "D97EC9DE-5D6A-42FD-B4CE-0516FD5455F6", @"");
            }

            // Make sure this is unique
            if (DefinedTypeCache.Read(new Guid("4573E600-4E00-4BE9-BA92-D17093C735D6")) == null)
            {
                RockMigrationHelper.AddDefinedType("Global", "Nursing Homes", "Nursing Home List", "4573E600-4E00-4BE9-BA92-D17093C735D6", @"");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "City", "Qualifier2", "", 0, "", "CEDC60C1-0F9E-4FE2-BE62-41716813C969");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Notes", "Qualifier8", "", 0, "", "C47A879E-F737-4156-A1FF-B7C465FDB9BD");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Phone", "Qualifier5", "", 0, "", "A4E41679-2CE6-479F-84D4-6821B25E3649");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Pastoral Minister", "Qualifier6", "", 0, "", "D97EC9DE-5D6A-42FD-B4CE-0516FD5455F7");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "State", "Qualifier3", "", 0, "", "239E507C-7C1B-4B4D-84D4-33C368843F05");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Street Address", "Qualifier1", "", 0, "", "73AC0DCE-CE90-4835-AAE7-E98B08F52E9D");
                RockMigrationHelper.AddDefinedTypeAttribute("4573E600-4E00-4BE9-BA92-D17093C735D6", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Zip", "Qualifier4", "", 0, "", "46A83E00-D530-48AD-B935-52C015DCA902");
                RockMigrationHelper.AddDefinedValue("4573E600-4E00-4BE9-BA92-D17093C735D6", "Sample Nursing Home", "", "0997ACB6-A4B4-4766-B573-3C44D14DF343", false);
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "239E507C-7C1B-4B4D-84D4-33C368843F05", @"KY");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "46A83E00-D530-48AD-B935-52C015DCA902", @"40023");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "73AC0DCE-CE90-4835-AAE7-E98B08F52E9D", @"2 Main St");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "A4E41679-2CE6-479F-84D4-6821B25E3649", @"(502) 111-1111");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "C47A879E-F737-4156-A1FF-B7C465FDB9BD", @"");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "CEDC60C1-0F9E-4FE2-BE62-41716813C969", @"Louisville");
                RockMigrationHelper.AddDefinedValueAttributeValue("0997ACB6-A4B4-4766-B573-3C44D14DF343", "D97EC9DE-5D6A-42FD-B4CE-0516FD5455F7", @"John Adams");
            }
            // Make sure to clear the Rock Cache so the defined type above will be there
            RockMemoryCache.Clear();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Global", "Liquid Templates", "Defined type to store various liquid templates for features in Rock.", "C3D44004-6951-44D9-8560-8567D705A48B");
            RockMigrationHelper.AddDefinedTypeAttribute("C3D44004-6951-44D9-8560-8567D705A48B", "9C204CD0-1233-41C5-818A-C5DA439445AA", "MIME Type", "MimeType", "The MIME type that should be returned when using the template.", 1, "", "4FBF9D1A-06A4-4941-B9F4-85D2C4C12F2A");
            RockMigrationHelper.AddDefinedTypeAttribute("C3D44004-6951-44D9-8560-8567D705A48B", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Template", "Template", "", 2, "", "1E13E409-B568-45D0-B4B6-556C87D61232");
            RockMigrationHelper.AddAttributeQualifier("1E13E409-B568-45D0-B4B6-556C87D61232", "editorMode", "3", "F28A4FD3-BFEE-4617-88A3-2132E71ADAD5");
            RockMigrationHelper.AddAttributeQualifier("1E13E409-B568-45D0-B4B6-556C87D61232", "editorTheme", "0", "9E9DFC12-81CB-4C71-A7E8-9F74E29CEA46");
            RockMigrationHelper.AddAttributeQualifier("1E13E409-B568-45D0-B4B6-556C87D61232", "editorHeight", "600", "6543D502-A6C5-4754-9755-AC6F88DF6CEA");

            RockMigrationHelper.AddDefinedValue("C3D44004-6951-44D9-8560-8567D705A48B", "Default RSS Channel", "The default RSS channel template used by the RSS provider if one is not provided.", "D6149581-9EFC-40D8-BD38-E92C0717BEDA");
            RockMigrationHelper.AddDefinedValueAttributeValue("D6149581-9EFC-40D8-BD38-E92C0717BEDA", "4FBF9D1A-06A4-4941-B9F4-85D2C4C12F2A", "application/rss+xml");
            RockMigrationHelper.AddDefinedValueAttributeValue("D6149581-9EFC-40D8-BD38-E92C0717BEDA", "1E13E409-B568-45D0-B4B6-556C87D61232", @"{% assign timezone = 'Now' | Date:'zzz' | Replace:':','' -%}
<?xml version=""1.0"" encoding=""utf-8""?>
<rss version=""2.0"" xmlns:atom=""http://www.w3.org/2005/Atom"">

<channel>
    <title>{{ Channel.Name }}</title>
    <link>{{ Channel.ChannelUrl }}</link>
    <description>{{ Channel.Description }}</description>
    <language>en-us</language>
    <ttl>{{ Channel.TimeToLive }}</ttl>
    <lastBuildDate>{{ 'Now' | Date:'ddd, dd MMM yyyy HH:mm:00' }} {{ timezone }}</lastBuildDate>
{% for item in Items -%}
    <item>
        <title>{{ item.Title }}</title>
        <guid>{{ Channel.ItemUrl }}?Item={{ item.Id }}</guid>
        <link>{{ Channel.ItemUrl }}?Item={{ item.Id }}</link>
        <pubDate>{{ item.StartDateTime | Date:'ddd, dd MMM yyyy HH:mm:00' }} {{ timezone }}</pubDate>
        <description>{{ item.Content | Escape }}</description>
    </item>
{% endfor -%}

</channel>
</rss>");

            // update new location of statementgenerator installer
            Sql("UPDATE [AttributeValue] set [Value] = 'http://storage.rockrms.com/externalapplications/sparkdevnetwork/statementgenerator/1.1.2/statementgenerator.exe' where [Guid] = '10BE2E03-7827-41B5-8CB2-DEB473EA107A'");

            // update to computed column to handle ISO 8601 formatted values
            Sql(@"
    ALTER TABLE [dbo].[AttributeValue] DROP COLUMN [ValueAsDateTime]
    ALTER TABLE [dbo].[AttributeValue] ADD [ValueAsDateTime] AS CASE WHEN [value] LIKE '____-__-__T__:__:__%' THEN CONVERT(datetime, CONVERT(datetimeoffset, [value])) ELSE CASE WHEN (LEN([value]) < 50 AND ISDATE( [value]) = 1) THEN CONVERT(datetime, [value]) ELSE NULL END END
");
        }
        private void AddDefinedTypeAndValues()
        {
            RockMigrationHelper.AddDefinedType("Check-in",
                                               "Attendance Types",
                                               "List of possible attendance types an attendance occurrence can have.",
                                               SystemGuid.DefinedType.CHECK_IN_ATTENDANCE_TYPES,
                                               string.Empty);

            RockMigrationHelper.UpdateDefinedValue(Rock.SystemGuid.DefinedType.CHECK_IN_ATTENDANCE_TYPES,
                                                   "Physical",
                                                   string.Empty,
                                                   SystemGuid.DefinedValue.CHECK_IN_ATTENDANCE_TYPE_PHYSICAL,
                                                   true);

            RockMigrationHelper.UpdateDefinedValue(Rock.SystemGuid.DefinedType.CHECK_IN_ATTENDANCE_TYPES,
                                                   "Virtual",
                                                   string.Empty,
                                                   SystemGuid.DefinedValue.CHECK_IN_ATTENDANCE_TYPE_VIRTUAL,
                                                   true);
        }
Ejemplo n.º 10
0
 public override void Up()
 {
     RockMigrationHelper.AddDefinedType("Tools", "Distance Mappable Entities", "Endpoint for getting distance for various entities. Route is /api/mapping/distance/{{DefinedValueId}}/{{Address}}", Constants.UniversalDefinedTypeGuid, @"");
     RockMigrationHelper.AddDefinedTypeAttribute("7F70ABE9-1705-4DED-BABE-6D720EC52914", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Entity Type", "EntityType", "", 1248, "", "A4E5D4F4-580D-459E-8C83-C6A92B47396A");
     RockMigrationHelper.AddDefinedTypeAttribute("7F70ABE9-1705-4DED-BABE-6D720EC52914", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Entity Id", "EntityId", "The id of the entity (Group Type Id, Parent Group Id or Attribute Id) to calculate distances from.", 1249, "", "1BC6FD9F-DDE2-4083-9539-7821C728014A");
     RockMigrationHelper.AddAttributeQualifier("1BC6FD9F-DDE2-4083-9539-7821C728014A", "ispassword", "False", "FDCC5DBA-F3A9-4896-BB35-F93B630612BB");
     RockMigrationHelper.AddAttributeQualifier("1BC6FD9F-DDE2-4083-9539-7821C728014A", "maxcharacters", "", "1257C2FD-BB2B-4BBE-992E-54BFCB829FF4");
     RockMigrationHelper.AddAttributeQualifier("1BC6FD9F-DDE2-4083-9539-7821C728014A", "showcountdown", "False", "7E762A8E-39D4-4EF2-8092-8C5407127BEA");
     RockMigrationHelper.AddAttributeQualifier("A4E5D4F4-580D-459E-8C83-C6A92B47396A", "fieldtype", "ddl", "8AE3FF18-6B1E-4096-8494-3B798AAA471B");
     RockMigrationHelper.AddAttributeQualifier("A4E5D4F4-580D-459E-8C83-C6A92B47396A", "repeatColumns", "", "4D143B57-93D5-47EE-9697-2F26879DBF73");
     RockMigrationHelper.AddAttributeQualifier("A4E5D4F4-580D-459E-8C83-C6A92B47396A", "values", "GroupType^Group Type,ParentGroup^Child Groups of Group,Campus^Campus,Attribute^Address Attribute", "97BB896B-A83D-4F96-8677-4FCD2609F1D5");
     RockMigrationHelper.UpdateDefinedValue("7F70ABE9-1705-4DED-BABE-6D720EC52914", "Blankenbaker Home Groups", "", "2E216362-0B05-4CE7-BBA8-E2C3DCAAEB07", false);
     RockMigrationHelper.UpdateDefinedValue("7F70ABE9-1705-4DED-BABE-6D720EC52914", "Campus", "", "EB39F521-F9AA-4812-BA8F-102C029C8516", false);
     RockMigrationHelper.UpdateDefinedValue("7F70ABE9-1705-4DED-BABE-6D720EC52914", "Content Channel Attributes", "", "F4D7D410-5096-460F-B740-4F6E0673CE16", false);
     RockMigrationHelper.UpdateDefinedValue("7F70ABE9-1705-4DED-BABE-6D720EC52914", "Home Groups", "", "7E83A576-07FC-49EA-98BC-73C123D24DD8", false);
     RockMigrationHelper.AddDefinedValueAttributeValue("2E216362-0B05-4CE7-BBA8-E2C3DCAAEB07", "1BC6FD9F-DDE2-4083-9539-7821C728014A", @"820057");
     RockMigrationHelper.AddDefinedValueAttributeValue("2E216362-0B05-4CE7-BBA8-E2C3DCAAEB07", "A4E5D4F4-580D-459E-8C83-C6A92B47396A", @"ParentGroup");
     RockMigrationHelper.AddDefinedValueAttributeValue("7E83A576-07FC-49EA-98BC-73C123D24DD8", "1BC6FD9F-DDE2-4083-9539-7821C728014A", @"60");
     RockMigrationHelper.AddDefinedValueAttributeValue("7E83A576-07FC-49EA-98BC-73C123D24DD8", "A4E5D4F4-580D-459E-8C83-C6A92B47396A", @"GroupType");
     RockMigrationHelper.AddDefinedValueAttributeValue("EB39F521-F9AA-4812-BA8F-102C029C8516", "A4E5D4F4-580D-459E-8C83-C6A92B47396A", @"Campus");
     RockMigrationHelper.AddDefinedValueAttributeValue("F4D7D410-5096-460F-B740-4F6E0673CE16", "1BC6FD9F-DDE2-4083-9539-7821C728014A", @"89281");
     RockMigrationHelper.AddDefinedValueAttributeValue("F4D7D410-5096-460F-B740-4F6E0673CE16", "A4E5D4F4-580D-459E-8C83-C6A92B47396A", @"Attribute");
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType(
                "Global",
                "JSON Web Token Configuration",
                "These values represent validation parameters for JSON Web Tokens.  The actual defined value is an OpenID configuration URL.  An example value if you are using Auth0 would be https://xxxxxx.auth0.com/.well-known/openid-configuration.  Attributes for these defined values define additional parameters for token verification and then Person Search Key association.",
                SystemGuid.DefinedType.JWT_CONFIGURATION,
                "");

            RockMigrationHelper.AddDefinedTypeAttribute(
                SystemGuid.DefinedType.JWT_CONFIGURATION,
                "59D5A94C-94A0-4630-B80A-BB25697D74C7",
                "Person Search Key",
                "PersonSearchTypeValue",
                "The person search keys to use when looking for the bearer of a token using a person search key",
                1037,
                "",
                Rock.SystemGuid.Attribute.DEFINED_VALUE_JWT_SEARCH_KEY);

            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.JWT_CONFIGURATION, "9C204CD0-1233-41C5-818A-C5DA439445AA", "Audience", "Audience", "The Audience for the JSON Web Token", 1034, "", SystemGuid.Attribute.DEFINED_VALUE_JWT_AUDIENCE);
            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.JWT_CONFIGURATION, "9C204CD0-1233-41C5-818A-C5DA439445AA", "Issuer", "Issuer", "The Issuer for the JSON Web Token", 1035, "", SystemGuid.Attribute.DEFINED_VALUE_JWT_ISSUER);
            RockMigrationHelper.AddDefinedTypeAttributeQualifier(SystemGuid.Attribute.DEFINED_VALUE_JWT_SEARCH_KEY, SystemGuid.DefinedType.PERSON_SEARCH_KEYS, "E1F99CD5-881D-485F-87F1-E74E713D43A1");
        }
Ejemplo n.º 12
0
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Global", "Mobile ListView Components", "List of components for available for Mobile List Views", AvalancheUtilities.MobileListViewComponent);
            RockMigrationHelper.AddDefinedTypeAttribute(AvalancheUtilities.MobileListViewComponent, Rock.SystemGuid.FieldType.TEXT, "ComponentType", "ComponentType", "Components that can be used to display a list of mobile list view items in Avalanche.", 0, "", "ACAE178E-E804-4F32-9BE3-2F020E7314CF");

            //Thumbnail ListView
            RockMigrationHelper.AddDefinedValue(AvalancheUtilities.MobileListViewComponent, "Thumbnail ListView", "Default list view. Supports images, icons, title and description.", "D9EA2C97-68E1-4D94-B881-F3AC4F2883A3");
            RockMigrationHelper.UpdateDefinedValueAttributeValue("D9EA2C97-68E1-4D94-B881-F3AC4F2883A3", "ACAE178E-E804-4F32-9BE3-2F020E7314CF", "Avalanche.Components.ListView.ThumbnailListView");

            //Column ListView
            RockMigrationHelper.AddDefinedValue(AvalancheUtilities.MobileListViewComponent, "Column ListView", "List view in columns. Supports images, icons, and title.", "1A637B48-35FB-43B2-9822-88AF2FD1D333");
            RockMigrationHelper.UpdateDefinedValueAttributeValue("1A637B48-35FB-43B2-9822-88AF2FD1D333", "ACAE178E-E804-4F32-9BE3-2F020E7314CF", "Avalanche.Components.ListView.ColumnListView");

            //Card ListView
            RockMigrationHelper.AddDefinedValue(AvalancheUtilities.MobileListViewComponent, "Card ListView", "Card based list view. Supports titles, images, icons, and descriptions in Markdown", "A6EFB571-56C8-44C2-8F87-B7F4DB4E1991");
            RockMigrationHelper.UpdateDefinedValueAttributeValue("A6EFB571-56C8-44C2-8F87-B7F4DB4E1991", "ACAE178E-E804-4F32-9BE3-2F020E7314CF", "Avalanche.Components.ListView.CardListView");

            //Horizontal ListView
            RockMigrationHelper.AddDefinedValue(AvalancheUtilities.MobileListViewComponent, "Horizontal ListView", "Horizontal layed out list view. Supports titles, images, icons.", "673B7DB5-2200-41D6-8857-9A7663B56C47");
            RockMigrationHelper.UpdateDefinedValueAttributeValue("673B7DB5-2200-41D6-8857-9A7663B56C47", "ACAE178E-E804-4F32-9BE3-2F020E7314CF", "Avalanche.Components.ListView.HorizontalListView");

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, "", "", "Avalanche Home Page", "Page which starts the Avalanche App", 0, "", "5FEFE20F-742E-4204-8A1C-7E400F802288");
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            CreateTable(
                "dbo.PersonalDevice",
                c => new
            {
                Id                      = c.Int(nullable: false, identity: true),
                PersonAliasId           = c.Int(nullable: false),
                DeviceRegistrationId    = c.String(),
                PersonalDeviceTypeId    = c.Int(nullable: false),
                NotificationsEnabled    = c.Boolean(nullable: false),
                CreatedDateTime         = c.DateTime(),
                ModifiedDateTime        = c.DateTime(),
                CreatedByPersonAliasId  = c.Int(),
                ModifiedByPersonAliasId = c.Int(),
                Guid                    = c.Guid(nullable: false),
                ForeignId               = c.Int(),
                ForeignGuid             = c.Guid(),
                ForeignKey              = c.String(maxLength: 100),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .ForeignKey("dbo.DefinedValue", t => t.PersonalDeviceTypeId)
            .ForeignKey("dbo.PersonAlias", t => t.PersonAliasId)
            .Index(t => t.PersonAliasId)
            .Index(t => t.PersonalDeviceTypeId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            RockMigrationHelper.AddDefinedType("Global", "Personal Device Type", "Device type for notifications", SystemGuid.DefinedType.PERSONAL_DEVICE_TYPE);
            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.PERSONAL_DEVICE_TYPE, "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Supports Notifications", "SupportsNotifications", "Does this personal device type support notifications", 0, "true", "D098823B-C6D6-44F4-9248-5F1971EE4009");
            RockMigrationHelper.AddAttributeQualifier("D098823B-C6D6-44F4-9248-5F1971EE4009", "SupportsNotificationsTrueText", "Yes", "51A181F4-9A3A-4356-B466-164BFDE0C5A5");
            RockMigrationHelper.AddAttributeQualifier("D098823B-C6D6-44F4-9248-5F1971EE4009", "SupportsNotificationsFalseText", "No", "B6AD7267-E54D-4660-B1B4-1B6DB0DF3402");
            RockMigrationHelper.AddDefinedValue(SystemGuid.DefinedType.PERSONAL_DEVICE_TYPE, "Mobile", "Personal Device Type Mobile", SystemGuid.DefinedValue.PERSONAL_DEVICE_TYPE_MOBILE);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // Assign GUID to Zoom and add security
            RockMigrationHelper.UpdateEntityType("rocks.kfs.Zoom.ZoomApp", ZoomGuid.EntityType.ZOOM, false, true);
            RockMigrationHelper.AddSecurityAuthForEntityType("rocks.kfs.Zoom.ZoomApp", 0, Rock.Security.Authorization.VIEW, true, Rock.SystemGuid.Group.GROUP_ADMINISTRATORS, 0, "6BC0A6D7-844F-49DF-BE40-5AD45EAB3CEE");
            RockMigrationHelper.AddSecurityAuthForEntityType("rocks.kfs.Zoom.ZoomApp", 1, Rock.Security.Authorization.VIEW, false, null, Rock.Model.SpecialRole.AllUsers.ConvertToInt(), "3921542F-476D-48B4-97F5-788709A1F4B4");

            RockMigrationHelper.AddNewEntityAttribute("rocks.kfs.Zoom.ZoomApp", Rock.SystemGuid.FieldType.ENCRYPTED_TEXT, "", "", "API Key", "", "The API Key for the Zoom Marketplace JWT app to use for KFS Zoom integration elements.", 0, "", "D53A2B48-C8B4-4481-B2AB-139CAF90C78C", "rocks.kfs.ZoomApiKey");
            RockMigrationHelper.AddNewEntityAttribute("rocks.kfs.Zoom.ZoomApp", Rock.SystemGuid.FieldType.ENCRYPTED_TEXT, "", "", "API Secret", "", "The API Secret for the Zoom Marketplace JWT app to use for KFS Zoom integration elements.", 0, "", "CB89B071-4866-41BD-ACB1-1810F5224A82", "rocks.kfs.ZoomApiSecret");

            // Only add the Reservation attribute if the Reservation table exists
            try
            {
                Sql(@"SELECT TOP 1 Id FROM _com_bemaservices_RoomManagement_Reservation");
                RockMigrationHelper.AddNewEntityAttribute("com.bemaservices.RoomManagement.Model.Reservation", Rock.SystemGuid.FieldType.GROUP_TYPE_GROUP, "", "", "Zoom Notify Group", "", "The Group to notify when a Zoom Room meeting is connected with this reservation.", 0, "", ZoomGuid.Attribute.ROOM_RESERVATION_GROUP_ATTRIBUTE, "rocks.kfs.ZoomNotifyGroup");
            }
            catch { }

            RockMigrationHelper.AddDefinedType("Zoom", "Zoom Rooms", "Zoom Rooms available for linking to Rock Locations.", ZoomGuid.DefinedType.ZOOM_ROOM);
            RockMigrationHelper.AddDefinedTypeAttribute(ZoomGuid.DefinedType.ZOOM_ROOM, Rock.SystemGuid.FieldType.TEXT, "Meeting Password", "rocks.kfs.ZoomMeetingPassword", "Zoom meeting password.", 1, "", ZoomGuid.Attribute.ZOOM_MEETING_PASSWORD);
            RockMigrationHelper.AddDefinedTypeAttribute(ZoomGuid.DefinedType.ZOOM_ROOM, Rock.SystemGuid.FieldType.BOOLEAN, "Join Before Host", "rocks.kfs.ZoomJoinBeforeHost", "Zoom meeting's Join Before Host setting.", 2, "false", ZoomGuid.Attribute.ZOOM_MEETING_JOIN_BEFORE_HOST);

            RockMigrationHelper.AddOrUpdateEntityAttribute("Rock.Model.Location", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Zoom Room", "", "The Zoom Room associated with this location.", 0, "", ZoomGuid.Attribute.ZOOM_ROOM_LOCATION_ENTITY_ATTRIBUTE, "rocks.kfs.ZoomRoom");
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            SchemaChangesUp();

            /** Section 1**/
            // Group Schedule Decline Reasons
            RockMigrationHelper.AddDefinedType("Group", "Group Schedule Decline Reason", "List of all possible schedule decline reasons.", "70C9F9C4-20CC-43DD-888D-9243853A0E52", @"");
            RockMigrationHelper.UpdateDefinedValue("70C9F9C4-20CC-43DD-888D-9243853A0E52", "Family Emergency", "", "7533A32D-CC7B-4218-A1CA-030FB4F2473B", false);
            RockMigrationHelper.UpdateDefinedValue("70C9F9C4-20CC-43DD-888D-9243853A0E52", "Have to Work", "", "8B9BF3F5-11CF-4E33-98A0-D48067A18103", false);
            RockMigrationHelper.UpdateDefinedValue("70C9F9C4-20CC-43DD-888D-9243853A0E52", "On Vacation / Out of Town", "", "BB2F0712-5C57-40E9-83BF-68876890EC7A", false);
            RockMigrationHelper.UpdateDefinedValue("70C9F9C4-20CC-43DD-888D-9243853A0E52", "Serving Elsewhere", "", "BBD314E2-B65A-4C23-8AE1-1ADFBD58C4B4", false);

            Sql(MigrationSQL._201905081957016_GroupScheduling_PopulateScheduleTemplates);

            PagesBlocksUp();

            AddSchedulingResponseEmailTemplateUp();

            AddSchedulingConfirmationSystemEmailUp();

            Sql(@"
-- Update existing GroupTypes to default ScheduleConfirmationEmailOffsetDays and ScheduleReminderEmailOffsetDays
UPDATE [GroupType]
SET [ScheduleConfirmationEmailOffsetDays] = 4
	,[ScheduleReminderEmailOffsetDays] = 2

-- Enable Group Scheduling for the Serving Teams group type, and set the default ScheduleConfirmationSystemEmailId
UPDATE [GroupType]
SET [IsSchedulingEnabled] = 1
	,ScheduleConfirmationSystemEmailId = (
		SELECT TOP 1 Id
		FROM SystemEmail
		WHERE [Guid] = 'F8E4CE07-68F5-4169-A865-ECE915CF421C'
		)
WHERE [Guid] = '2C42B2D4-1C5F-4AD5-A9AD-08631B872AC4'");
        }
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Steps to Care", "Status", "The status of Care Needs.", SystemGuid.DefinedType.CARE_NEED_STATUS);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_STATUS, "Open", "", SystemGuid.DefinedValue.CARE_NEED_STATUS_OPEN, true);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_STATUS, "Closed", "", SystemGuid.DefinedValue.CARE_NEED_STATUS_CLOSED, true);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_STATUS, "Follow Up", "", SystemGuid.DefinedValue.CARE_NEED_STATUS_FOLLOWUP, true);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_STATUS, "Long Term Care", "", SystemGuid.DefinedValue.CARE_NEED_STATUS_LONGTERMCARE, false);

            RockMigrationHelper.AddDefinedType("Steps to Care", "Category", "Categories used for Care Needs and Care workers to color code and assign them.", SystemGuid.DefinedType.CARE_NEED_CATEGORY);
            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "D747E6AE-C383-4E22-8846-71518E3DD06F", "Color", "Color", "", 1056, "", "FF84E9A7-9BD6-4987-A942-AD4703303B12");
            RockMigrationHelper.AddAttributeQualifier("FF84E9A7-9BD6-4987-A942-AD4703303B12", "selectiontype", "Color Picker", "E3E0FD56-AEDF-4A44-87E2-B2E5B74A32F9");
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "Birth", "", "EA93B6A9-F151-475D-89B4-C7C24AE603B8", false);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "Grief", "", "6E092B06-BD9C-400F-9426-75CED70FF93E", false);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "Hospital/Surgery", "", "167B982F-1C66-4228-B867-3A64AEFE37F1", false);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "Milestone", "", "087FF723-7C2A-46EE-83F6-F1EF7F0F33C7", false);
            RockMigrationHelper.UpdateDefinedValue(SystemGuid.DefinedType.CARE_NEED_CATEGORY, "Other", "", "6BD7404D-90DD-4C94-9B0C-B516DEACB306", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("087FF723-7C2A-46EE-83F6-F1EF7F0F33C7", "FF84E9A7-9BD6-4987-A942-AD4703303B12", @"rgb(76,175,80)");
            RockMigrationHelper.AddDefinedValueAttributeValue("167B982F-1C66-4228-B867-3A64AEFE37F1", "FF84E9A7-9BD6-4987-A942-AD4703303B12", @"rgb(244,67,54)");
            RockMigrationHelper.AddDefinedValueAttributeValue("6BD7404D-90DD-4C94-9B0C-B516DEACB306", "FF84E9A7-9BD6-4987-A942-AD4703303B12", @"rgb(156,39,176)");
            RockMigrationHelper.AddDefinedValueAttributeValue("6E092B06-BD9C-400F-9426-75CED70FF93E", "FF84E9A7-9BD6-4987-A942-AD4703303B12", @"#757272");
            RockMigrationHelper.AddDefinedValueAttributeValue("EA93B6A9-F151-475D-89B4-C7C24AE603B8", "FF84E9A7-9BD6-4987-A942-AD4703303B12", @"rgb(255,235,59)");

            RockMigrationHelper.UpdateNoteType("Steps to Care - Care Need", "rocks.kfs.StepsToCare.Model.CareNeed", true, "922403D1-FA11-4159-B325-B818237AE9B3", true, "fas fa-notes-medical");
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            /* Create Content Channel Type of Content Component*/
            Sql(MigrationSQL._201809142151587_ContentComponents_CreateContentComponentChannelType);

            /* Add Content Component Template defined type */
            RockMigrationHelper.AddDefinedType("Content Channel", "Content Component Template", "Lava Template that can be used with a Content Component block.", Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE);
            RockMigrationHelper.AddDefinedTypeAttribute(Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE, Rock.SystemGuid.FieldType.LAVA, "Display Lava", "DisplayLava", "The Lava Template to use when rendering the Content Component", 0, "", "FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE");
            RockMigrationHelper.AddAttributeQualifier("FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", "editorHeight", "400", "573D06B9-5BDE-4E64-B0B1-85E167FCB47A");
            RockMigrationHelper.AddAttributeQualifier("FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", "editorTheme", "0", "94E49DA2-F796-4F83-A857-A9751F273CF6");
            RockMigrationHelper.AddAttributeQualifier("FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", "editorMode", "3", "17B8ECCA-2F67-4130-A43D-4D76C71D11D0");

            RockMigrationHelper.AddDefinedValue(Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE, "Hero", "", "3E7D4D0C-8238-4A5F-9E5F-34E4DFBF7725");
            RockMigrationHelper.AddDefinedValueAttributeValue("3E7D4D0C-8238-4A5F-9E5F-34E4DFBF7725", "FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", MigrationSQL._201809142151587_ContentComponents_Hero);

            RockMigrationHelper.AddDefinedValue(Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE, "Ad Unit", "", "902D960C-0B7B-425E-9CEA-94CF215AABE4");
            RockMigrationHelper.AddDefinedValueAttributeValue("902D960C-0B7B-425E-9CEA-94CF215AABE4", "FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", MigrationSQL._201809142151587_ContentComponents_AdUnit);

            RockMigrationHelper.AddDefinedValue(Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE, "Side By Side", "", "EC429625-767E-4F69-BB48-F55DA3C836A3");
            RockMigrationHelper.AddDefinedValueAttributeValue("EC429625-767E-4F69-BB48-F55DA3C836A3", "FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", MigrationSQL._201809142151587_ContentComponents_SideBySide);

            RockMigrationHelper.AddDefinedValue(Rock.SystemGuid.DefinedType.CONTENT_COMPONENT_TEMPLATE, "Card", "", "54A6FE8C-B38F-46DB-81F7-A7648886B592");
            RockMigrationHelper.AddDefinedValueAttributeValue("54A6FE8C-B38F-46DB-81F7-A7648886B592", "FF5C0A7E-F3CD-46F0-934D-7C73B7CC35EE", MigrationSQL._201809142151587_ContentComponents_Card);

            /* Add Content Component Templates page to CMS Config page*/
            RockMigrationHelper.AddPage(true, "B4A24AB7-9369-4055-883F-4F4892C39AE3", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Content Component Templates", "", "F1ED10C2-A17D-4310-9F86-76E11A4A7ED2", "fa fa-list-alt");   // Site:Rock RMS
            // Add Block to Page: Content Component Templates, Site: Rock RMS
            RockMigrationHelper.AddBlock(true, "F1ED10C2-A17D-4310-9F86-76E11A4A7ED2", "", "0AB2D5E9-9272-47D5-90E4-4AA838D2D3EE", "Content Component Template List", "Main", @"", @"", 0, "9DFBA51C-FDBE-452E-9763-38CA182555F2");
            // Attrib Value for Block:Content Component Template List, Attribute:Defined Type Page: Content Component Templates, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("9DFBA51C-FDBE-452E-9763-38CA182555F2", "9280D61F-C4F3-4A3E-A9BB-BCD67FF78637", @"313B579F-F442-4247-ADBB-BBD25E255003");
            // Attrib Value for Block:Content Component Template List, Attribute:core.CustomGridColumnsConfig Page: Content Component Templates, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("9DFBA51C-FDBE-452E-9763-38CA182555F2", "87DAF7ED-AAF5-4D5C-8339-CB30B16CC9FF", @"");
            // Attrib Value for Block:Content Component Template List, Attribute:core.CustomGridEnableStickyHeaders Page: Content Component Templates, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("9DFBA51C-FDBE-452E-9763-38CA182555F2", "945FE831-D33C-49C6-B21D-00EACA9A43D7", @"False");

            /* New Content Component Block Type*/
            RockMigrationHelper.UpdateBlockType("Content Component", "Block to manage and display content.", "~/Blocks/Cms/ContentComponent.ascx", "CMS", "AD802CA1-842C-47F0-B5E9-739FE2B4A2BD");
            // Attrib for BlockType: Content Component:Item Cache Duration
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Item Cache Duration", "ItemCacheDuration", "", @"Number of seconds to cache the content item specified by the parameter.", 0, @"0", "89B2C635-7F93-469B-BA8A-8F52609238DF");
            // Attrib for BlockType: Content Component:Content Channel
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "D835A0EC-C8DB-483A-A37C-E8FB6E956C3D", "Content Channel", "ContentChannel", "", @"", 0, @"", "8F7BBA6A-88B8-4568-BF7F-5043AAB23BDC");
            // Attrib for BlockType: Content Component:Cache Tags
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "BD0D9B57-2A41-4490-89FF-F01DAB7D4904", "Cache Tags", "CacheTags", "", @"Cached tags are used to link cached content so that it can be expired as a group", 0, @"", "DD660761-0894-4297-81EE-535135EF12E7");
            // Attrib for BlockType: Content Component:Filter Id
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Filter Id", "FilterId", "", @"The data filter that is used to filter items", 0, @"0", "0F7971F3-DB75-4E4E-9193-D87A02CB5691");
            // Attrib for BlockType: Content Component:Content Component Template
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "Content Component Template", "ContentComponentTemplate", "", @"", 0, @"", "F33C44C4-615E-4254-9A97-9DD1D9922C32");
            // Attrib for BlockType: Content Component:Allow Multiple Content Items
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Allow Multiple Content Items", "AllowMultipleContentItems", "", @"", 0, @"False", "F11E0BF3-13BD-4A00-86F6-1BA74790EF61");
            // Attrib for BlockType: Content Component:Output Cache Duration
            RockMigrationHelper.UpdateBlockTypeAttribute("AD802CA1-842C-47F0-B5E9-739FE2B4A2BD", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Output Cache Duration", "OutputCacheDuration", "", @"Number of seconds to cache the resolved output. Only cache the output if you are not personalizing the output based on current user, current page, or any other merge field value.", 0, @"", "1344878E-D977-489F-BE0D-5AA761521145");

            /* Set Content Component and Content Channel Item View as 'Common' block types */
            Sql($"UPDATE [BlockType] SET [IsCommon] = 1 WHERE [Guid] in ('AD802CA1-842C-47F0-B5E9-739FE2B4A2BD{Rock.SystemGuid.BlockType.CONTENT_COMPONENT}','{Rock.SystemGuid.BlockType.CONTENT_CHANNEL_ITEM_VIEW}')");

            /* Do a Switch-a-roo to get a couple of CMS blocks renamed to Content Channel Item View and Content Channel Navigation blocks so they make more sense */

            // Change the Name and Path of old "Content Channel Item View" to "Content Channel Navigation" (This is a better name for it and it also lets us name "Content Channel View Detail" get renamed "Content Channel Item View")
            RockMigrationHelper.UpdateBlockTypeByGuid("Content Channel Navigation", "Block to display a menu of content channels/items that user is authorized to view.", "~/Blocks/Cms/ContentChannelNavigation.ascx", "CMS", Rock.SystemGuid.BlockType.CONTENT_CHANNEL_NAVIGATION);

            // Change the Name and Path of old "Content Channel View Detail" to "Content Channel Item View" (This is a better name for it now that we got the old one renamed to make the name available) )
            RockMigrationHelper.UpdateBlockTypeByGuid("Content Channel Item View", "Block to display a specific content channel item.", "~/Blocks/Cms/ContentChannelItemView.ascx", "CMS", Rock.SystemGuid.BlockType.CONTENT_CHANNEL_ITEM_VIEW);

            // Update the name of the Content CHannel Item View blocks on Series Detail, Site: External Website and  Message Detail, Site: External Website
            Sql(@"UPDATE [Block]
SET [Name] = 'Content Channel Item View'
WHERE [Name] = 'Content Channel View Detail'
	AND [Guid] IN (
		'847E12E0-A7FC-4BD5-BD7E-1E9D435510E7'
		,'71D998C7-9F27-4B8A-937A-64C5EFC4783A'
		)"        );
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            CreateTable(
                "dbo.BackgroundCheck",
                c => new
            {
                Id                      = c.Int(nullable: false, identity: true),
                PersonAliasId           = c.Int(nullable: false),
                WorkflowId              = c.Int(),
                RequestDate             = c.DateTime(nullable: false),
                ResponseDate            = c.DateTime(),
                RecordFound             = c.Boolean(),
                ResponseXml             = c.String(),
                ResponseDocumentId      = c.Int(),
                CreatedDateTime         = c.DateTime(),
                ModifiedDateTime        = c.DateTime(),
                CreatedByPersonAliasId  = c.Int(),
                ModifiedByPersonAliasId = c.Int(),
                Guid                    = c.Guid(nullable: false),
                ForeignId               = c.Int(),
                ForeignGuid             = c.Guid(),
                ForeignKey              = c.String(maxLength: 100),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.PersonAliasId, cascadeDelete: true)
            .ForeignKey("dbo.BinaryFile", t => t.ResponseDocumentId)
            .ForeignKey("dbo.Workflow", t => t.WorkflowId, cascadeDelete: true)
            .Index(t => t.PersonAliasId)
            .Index(t => t.WorkflowId)
            .Index(t => t.ResponseDocumentId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true)
            .Index(t => t.ForeignId)
            .Index(t => t.ForeignGuid)
            .Index(t => t.ForeignKey);

            AddColumn("dbo.Location", "County", c => c.String(maxLength: 50));

            RockMigrationHelper.AddDefinedType("Global", "Protect My Ministry DVR Jurisdiction Codes", "The jurisdication codes available for MVR requests from Protect My Ministry.", "2F8821E8-05B9-4CD5-9FA4-303662AAC85D");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "AL", "Alabama");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "AK", "Alaska");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "AZ39M", "Arizona (39 month)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "AZ5Y", "Arizona 5 Year (Commercial use only)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ARC", "Arkansas (Commercial)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ARD", "Arkansas (Driver Check)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ARI", "Arkansas (Insurance)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "CA", "California");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "CO", "Colorado");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "CT", "Connecticut");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "DE", "Delaware");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "DC", "District of Columbia");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "FL3", "Florida (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "FL7", "Florida (7 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "FLU", "Florida (Unlimited)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "GA3Y", "Georgia (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "GA7Y", "Georgia (7 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "GAL", "Georgia LRI");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "HI", "Hawaii");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ID", "Idaho");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "IL", "Illinois");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "IN", "Indiana");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "IA", "Iowa");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "KS", "Kansas");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "KY", "Kentucky");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "LA", "Louisiana");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ME", "Maine");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MD", "Maryland");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MA", "Massachusetts");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MI", "Michigan");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MN1M", "Minnesota (1 Month)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MN1Y", "Minnesota (1 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MNC", "Minnesota (Complete)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MS", "Mississippi");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MO1M", "Missouri (1 Month)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MO1Y", "Missouri (1 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MOC", "Missouri (Complete)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "MT", "Montana");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NE", "Nebraska");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NV", "Nevada");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NH", "New Hampshire");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NJ", "New Jersey");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NM", "New Mexico");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NY", "New York");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NC3Y", "North Carolina (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "NC7Y", "North Carolina (7 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ND", "North Dakota");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "OH", "Ohio");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "OK", "Oklahoma");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "OR", "Oregon");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "ORI", "Oregon (Insurance)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "PA10Y", "Pennsylvania (10 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "PA3Y", "Pennsylvania (3 Year Insurance)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "RI", "Rhode Island");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "SC10Y", "South Carolina (10 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "SC3Y", "South Carolina (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "SD", "South Dakota");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "TN3Y", "Tennessee (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "TNL", "Tennessee (Limited MVR)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "TX3", "Texas (3 Year)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "TXDC", "Texas (Driver Check)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "UT", "Utah");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "VT", "Vermont");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "VA", "Virginia");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WA", "Washington");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WADC", "Washington (Driver Check)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WV", "West Virginia");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WI", "Wisconsin");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WIDC", "Wisconsin (Driver Check)");
            RockMigrationHelper.AddDefinedValue("2F8821E8-05B9-4CD5-9FA4-303662AAC85D", "WY", "Wyoming");

            // Background Check Package Defined Type and attributes
            RockMigrationHelper.AddDefinedType("Global", "Background Check Types", "The type of background checks that are available to be used.", "BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Package Name", "PMMPackageName", "The exact name (case is important) of the PMM Package to submit.", 0, "", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "9C204CD0-1233-41C5-818A-C5DA439445AA", "County Criminal Search Default County", "DefaultCounty", "Include a valid county name to request a County Criminal Search (a default county or state is required when using the PLUS package).", 1, "", "39AEB614-BA28-485D-B033-3DD52055DC20");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Use Home Address County for County search", "SendHomeCounty", "If the person's home address includes a county, use that instead of the default county.", 2, "False", "EC942623-3B32-4EF4-A371-D4312A7AF3F8");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Statewide Criminal Search Default State", "DefaultState", "Include a valid state to request a Statewide Criminal Search (a default state or county is required when using the PLUS package).", 3, "", "17093E08-F287-4A77-87B7-5FFA2337A8B7");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Use Home Address State For Statewide Search", "SendHomeState", "If the person's home address includes a state, use that instead of the default state.", 4, "False", "96B3451B-4851-4509-8130-231A2042A4A1");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "MVR Jurisdiction Code", "MVRJurisdiction", "Select an MVR Jurisdiction code to request a Motor Vehicle Record search.", 5, "", "1169005D-662B-4380-9FFD-BD6177037329");
            RockMigrationHelper.AddDefinedTypeAttribute("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Use Home State for MVR Search", "SendHomeStateMVR", "If the person's home address includes a state, use that instead of state from jurisdication code.", 6, "False", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0");

            RockMigrationHelper.AddAttributeQualifier("1169005D-662B-4380-9FFD-BD6177037329", "allowmultiple", "False", "DD29AF91-A5F2-4D61-8674-963C107EB465");
            RockMigrationHelper.AddAttributeQualifier("1169005D-662B-4380-9FFD-BD6177037329", "definedtype", "", "9599BD09-1B79-4E00-8FC6-D9DC19010E56");
            RockMigrationHelper.AddAttributeQualifier("1169005D-662B-4380-9FFD-BD6177037329", "displaydescription", "True", "3F7E913C-CE65-4B67-A248-E99028FCD18F");

            // Seven Year Auto Package with attribute values
            RockMigrationHelper.UpdateDefinedValue("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "Seven Year Automatic",
                                                   "The Seven Year Automatic package is the premier screening option and is the recommended package for all staff and pastors serving at your organization. Some churches also use this package for all volunteers.", "8470F648-58B6-405A-8C4D-CD661F6678DB", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70", "Auto County 7 yrs");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "39AEB614-BA28-485D-B033-3DD52055DC20", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "EC942623-3B32-4EF4-A371-D4312A7AF3F8", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "17093E08-F287-4A77-87B7-5FFA2337A8B7", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "96B3451B-4851-4509-8130-231A2042A4A1", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "1169005D-662B-4380-9FFD-BD6177037329", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("8470F648-58B6-405A-8C4D-CD661F6678DB", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0", "False");

            // BASIC Package with attribute values
            RockMigrationHelper.UpdateDefinedValue("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "BASIC",
                                                   "The Basic Package is the minimum recommended package for all volunteer and staff screenings. It includes SSN Verification and Address History, National Criminal Database Search, National Sex Offender Search, Re-verification of criminal records, Alias Names.",
                                                   "B091BE26-1EEA-4601-A65A-A3A75CDD7506", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70", "BASIC");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "39AEB614-BA28-485D-B033-3DD52055DC20", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "EC942623-3B32-4EF4-A371-D4312A7AF3F8", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "17093E08-F287-4A77-87B7-5FFA2337A8B7", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "96B3451B-4851-4509-8130-231A2042A4A1", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "1169005D-662B-4380-9FFD-BD6177037329", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("B091BE26-1EEA-4601-A65A-A3A75CDD7506", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0", "False");

            // PLUS Package with attribute values
            RockMigrationHelper.UpdateDefinedValue("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "PLUS",
                                                   "Depending on your state, it may be recommended to use the PLUS package instead of the Basic. The PLUS package includes everything in the BASIC package with the addition of one county or statewide criminal court search.",
                                                   "C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70", "PLUS");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "39AEB614-BA28-485D-B033-3DD52055DC20", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "EC942623-3B32-4EF4-A371-D4312A7AF3F8", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "17093E08-F287-4A77-87B7-5FFA2337A8B7", "AZ");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "96B3451B-4851-4509-8130-231A2042A4A1", "True");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "1169005D-662B-4380-9FFD-BD6177037329", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("C542EFC7-1D22-4DBD-AF09-5C583FCD4FEF", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0", "False");

            // PA 153 Package with attribute values
            RockMigrationHelper.UpdateDefinedValue("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "Pennsylvania Act 153",
                                                   "If your organization is located in Pennsylvania, This package should be used when screening any volunteers or staff that will interact with children. This package includes all of the screening and reporting requirements mandated by Pennsylvania Act 153.",
                                                   "AD47AECE-6779-41C5-A5C4-D3A9C1F849BEF", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70", "PA Package");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "39AEB614-BA28-485D-B033-3DD52055DC20", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "EC942623-3B32-4EF4-A371-D4312A7AF3F8", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "17093E08-F287-4A77-87B7-5FFA2337A8B7", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "96B3451B-4851-4509-8130-231A2042A4A1", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "1169005D-662B-4380-9FFD-BD6177037329", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("AD47AECE-6779-41C5-A5C4-D3A9C1F849BE", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0", "False");

            // MVR Only
            RockMigrationHelper.UpdateDefinedValue("BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "Motor Vehicle Record Search", "An A la carte Motor Vehicle Record (MVR) search.", "D27F591E-0016-4924-BC8D-F3F488DF3F8C", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "01E4D61D-6E23-4EF3-8AE1-6919590B0E70", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "39AEB614-BA28-485D-B033-3DD52055DC20", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "EC942623-3B32-4EF4-A371-D4312A7AF3F8", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "17093E08-F287-4A77-87B7-5FFA2337A8B7", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "96B3451B-4851-4509-8130-231A2042A4A1", "False");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "1169005D-662B-4380-9FFD-BD6177037329", "");
            RockMigrationHelper.AddDefinedValueAttributeValue("D27F591E-0016-4924-BC8D-F3F488DF3F8C", "9F7FD96A-BE7C-4CA3-91F8-10A0D1D6C1D0", "True");

            // Change the workflow package attribute to be a defined value field and add the qualifiers
            RockMigrationHelper.UpdateWorkflowTypeAttribute("16D12EF7-C546-4039-9036-B73D118EDC90", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "Type", "PackageType", "Value should be the type of background check to request from the vendor.", 9, @"", "A4CB9461-D77F-40E0-8DFF-C7838D78F2EC");   // Background Check:Type
            RockMigrationHelper.AddAttributeQualifier("A4CB9461-D77F-40E0-8DFF-C7838D78F2EC", "definedtype", @"BC2FDF9A-93B8-4325-8DE9-2F7B1943BFDF", "D03418DA-BC29-47C3-AA36-1051841C62F9");
            RockMigrationHelper.AddAttributeQualifier("A4CB9461-D77F-40E0-8DFF-C7838D78F2EC", "allowmultiple", @"False", "CE080F26-ACDA-45FB-BE30-0D88688FF99B");
            RockMigrationHelper.AddAttributeQualifier("A4CB9461-D77F-40E0-8DFF-C7838D78F2EC", "displaydescription", @"False", "101C2F35-28F8-4E20-B1E2-812D8F784E8F");

            RockMigrationHelper.AddPage("C831428A-6ACD-4D49-9B2D-046D399E3123", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Protect My Ministry", "", "E7F4B733-60FF-4FA3-AB17-0832E123F6F2", "fa fa-shield", "21DA6141-0A03-4F00-B0A8-3B110FBE2438");   // Site:Rock RMS
            RockMigrationHelper.UpdateBlockType("Protect My Ministry Settings", "Block for updating the settings used by the Protect My Ministry integration.", "~/Blocks/Security/BackgroundCheck/ProtectMyMinistrySettings.ascx", "Security  > Background Check", "AF36FA7E-BD2A-42A3-AF30-2FEBC1C46663");
            RockMigrationHelper.UpdateBlockType("Request List", "Lists all the background check requests.", "~/Blocks/Security/BackgroundCheck/RequestList.ascx", "Security > Background Check", "A25BE440-6A54-4A8C-9359-74DB5AE7E5F3");
            RockMigrationHelper.AddBlock("E7F4B733-60FF-4FA3-AB17-0832E123F6F2", "", "AF36FA7E-BD2A-42A3-AF30-2FEBC1C46663", "Protect My Ministry Settings", "Main", "", "", 0, "63AA839B-B6A1-4A57-A0DC-2F5B6DDA71BE");
            RockMigrationHelper.AddBlock("E7F4B733-60FF-4FA3-AB17-0832E123F6F2", "", "A25BE440-6A54-4A8C-9359-74DB5AE7E5F3", "Request List", "Main", "", "", 1, "29BDA0D1-7595-4ABC-ABA3-5E3E6409B21F");

            // Attrib for BlockType: Request List:Workflow Detail Page
            RockMigrationHelper.AddBlockTypeAttribute("A25BE440-6A54-4A8C-9359-74DB5AE7E5F3", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Workflow Detail Page", "WorkflowDetailPage", "", "The page to view details about the background check workflow", 0, @"", "EBD0D19C-E73D-41AE-82D4-C89C21C35998");

            // Attrib Value for Block:Request List, Attribute:Workflow Detail Page Page: Protect My Ministry, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("29BDA0D1-7595-4ABC-ABA3-5E3E6409B21F", "EBD0D19C-E73D-41AE-82D4-C89C21C35998", @"ba547eed-5537-49cf-bd4e-c583d760788c,0018e88f-1fea-48e2-93d6-dc254a0c4005");

            RockMigrationHelper.UpdatePersonAttribute(Rock.SystemGuid.FieldType.TEXT, "4D1E1EBA-ABF2-4A7C-8ADF-65CB5AAE94E2", "Driver''s License Number", "com.sparkdevnetwork.DLNumber", "", "Driver''s License Number used for Motor Vehicle Record searches", 5, "", "04549D93-C674-441C-A6CF-ACDFA0EDB163");

            Sql(MigrationSQL._201511182310362_ProtectMyMinistry);
        }
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Workflow", "Text To Workflow", "Matches SMS phones and keywords to launch workflows of various types", "2CACB86F-D811-4483-98E1-272F1FF8FF5D", @"

                The following merge fields are available for both the ''Name Template'' and ''Workflow Attributes'' attributes.
                <p>
                    <a data-toggle=""collapse""  href=""#collapsefields"" class=''btn btn-action btn-xs''>show/hide fields</a>
                </p>

                <div id=""collapsefields"" class=""panel-collapse collapse"">
                <pre>
                {
                   ""FromPhone"":""+15555555555"",
                   ""ToPhone"":""+15555555555"",
                   ""MessageBody"":""keyword"",
                   ""ReceivedTime"":""10:02 PM"",
                   ""ReceivedDate"":""7/29/2014"",
                   ""FromPerson"":{
                      ""FullName"":""Ted Decker"",
                      ""IsDeceased"":false,
                      ""TitleValueId"":null,
                      ""FirstName"":""Theodore"",
                      ""NickName"":""Ted"",
                      ""MiddleName"":"""",
                      ""LastName"":""Decker"",
                      ""SuffixValueId"":null,
                      ""PhotoId"":36,
                      ""BirthDay"":10,
                      ""BirthMonth"":2,
                      ""BirthYear"":1976,
                      ""Gender"":1,
                      ""MaritalStatusValueId"":143,
                      ""AnniversaryDate"":null,
                      ""GraduationDate"":""1994-06-01T00:00:00"",
                      ""GivingGroupId"":41,
                      ""Email"":""*****@*****.**"",
                      ""IsEmailActive"":true,
                      ""EmailNote"":null,
                      ""EmailPreference"":0,
                      ""ReviewReasonNote"":null,
                      ""InactiveReasonNote"":null,
                      ""SystemNote"":null,
                      ""ViewedCount"":null,
                      ""PrimaryAliasId"":2,
                      ""BirthdayDayOfWeek"":""Monday"",
                      ""BirthdayDayOfWeekShort"":""Mon"",
                      ""PhotoUrl"":""/GetImage.ashx?id=36"",
                      ""BirthDate"":""1976-02-10T00:00:00"",
                      ""Age"":38,
                      ""DaysToBirthday"":196,
                      ""Grade"":33,
                      ""GradeFormatted"":"""",
                      ""CreatedDateTime"":null,
                      ""ModifiedDateTime"":""2014-07-23T23:26:18.357"",
                      ""CreatedByPersonAliasId"":null,
                      ""ModifiedByPersonAliasId"":1,
                      ""Attributes"":null,
                      ""AttributeValues"":null,
                      ""Id"":2,
                      ""Guid"":""8fedc6ee-8630-41ed-9fc5-c7157fd1eaa4"",
                      ""UrlEncodedKey"":""EAAAAHkbB7e!2bYK0Xdq9Ib9ePIpblOpW9jAghYRMyMWe9vjb3BF8mvzaL6CCNVZrs6zk4nNCgX9JkXkmY3KRudX!2bKO!2fg!3d"",
	                  ""ConnectionStatusValue"":{
                         ""Order"":0,
                         ""Name"":""Member"",
                         ""Description"":""Applied to individuals who have completed all requirements established to become a member."",
                         ""Id"":65,
                         ""Guid"":""41540783-d9ef-4c70-8f1d-c9e83d91ed5f"",
                      },
                      ""MaritalStatusValue"":{
                         ""Order"":0,
                         ""Name"":""Married"",
                         ""Description"":""Used with an individual is married."",
                         ""Id"":143,
                         ""Guid"":""5fe5a540-7d9f-433e-b47e-4229d1472248"",
                         ""UrlEncodedKey"":""EAAAAHiZvJY3Dkl85B1F8SJ2AnS8onTRarYspmUq5VOIkKRWurg4E913MdwkRq2tzQWF7qQoraHlMey24opvgDMvNQ8!3d""
                      },
                      ""PhoneNumbers"":[
                         {
                            ""NumberTypeValue"":{
                               ""Order"":1,
                               ""Name"":""Home"",
                               ""Description"":""Home phone number"",
                               ""Id"":13,
                               ""Guid"":""aa8732fb-2cea-4c76-8d6d-6aaa2c6a4303"",
                               ""UrlEncodedKey"":""EAAAABRiGGLD6CTiCKqb29OBr2KkOwimKb0BQp8oKV0gvKIzSAwNzMXg!2bwvQUHvY!2brdPIJZ7nBdJ1QcwbUsUwB7ITYc!3d""
                            },
                            ""CountryCode"":""1"",
                            ""Number"":""6235553322"",
                            ""NumberFormatted"":""(623) 555-3322"",
                            ""Extension"":null,
                            ""NumberTypeValueId"":13,
                            ""IsMessagingEnabled"":false,
                            ""IsUnlisted"":false,
                            ""Description"":null,
                            ""NumberFormattedWithCountryCode"":""+1 (623) 555-3322"",
                            ""Id"":1,
                            ""Guid"":""fdfbd202-a67e-4ea5-9cff-2b939593d054"",
                            ""UrlEncodedKey"":""EAAAALquQ6scz74JCg3iV50!2bnF0LIDQHyjyJOYxwRn7BSbFX4Z6Y76g7eBbFoXpkSQ67FjHd8VZ2M4!2bZzzbAHhKLYtA!3d""
                         },
                         {
                            ""NumberTypeValue"":{
                               ""Order"":2,
                               ""Name"":""Work"",
                               ""Description"":""Work phone number"",
                               ""Guid"":""2cc66d5a-f61c-4b74-9af9-590a9847c13c"",
                               ""UrlEncodedKey"":""EAAAAAXigHXhetFtBvzV!2bFC7PbJC!2bYcv77nHDYssZobfHDgyvd004RG7xxctsdccwZIHFajKAcfzgw2mwH7IS8iCJ8Y!3d""
                            },
                            ""CountryCode"":""1"",
                            ""Number"":""6235552444"",
                            ""NumberFormatted"":""(623) 555-2444"",
                            ""Extension"":null,
                            ""NumberTypeValueId"":136,
                            ""IsMessagingEnabled"":false,
                            ""IsUnlisted"":false,
                            ""Description"":null,
                            ""NumberFormattedWithCountryCode"":""+1 (623) 555-2444"",
                            ""Id"":3,
                            ""Guid"":""e26f602c-a742-4ee5-b332-5583b2bd31c0"",
                            ""UrlEncodedKey"":""EAAAADItUMe9!2bgCRZ3uugX9STAPz7fllpXVUFdK65R5DlIMYjyjCFDwQIJ7rp3tZrztTsAMsRk5AbuocEH3TvXY3Cgk!3d""
                         },
                         {
                            ""NumberTypeValue"":{
                               ""Order"":0,
                               ""Name"":""Mobile"",
                               ""Description"":""Mobile/Cell phone number"",
                               ""Id"":12,
                               ""Guid"":""407e7e45-7b2e-4fcd-9605-ecb1339f2453"",
                               ""UrlEncodedKey"":""EAAAANaN5diFoMocUiXgsoPb7g!2fwZ0NA8lvD8HPIevtFueL1YrEBGCM9GQF4FANqYrid4yQZm5nFUR!2bjt9JfpMf12Rg!3d""
                            },
                            ""CountryCode"":""1"",
                            ""Number"":""6238662792"",
                            ""NumberFormatted"":""(623) 866-2792"",
                            ""Extension"":null,
                            ""NumberTypeValueId"":12,
                            ""IsMessagingEnabled"":true,
                            ""IsUnlisted"":false,
                            ""Description"":null,
                            ""NumberFormattedWithCountryCode"":""+1 (623) 866-2792"",
                            ""Id"":15,
                            ""Guid"":""96e6b17e-7a18-4231-915a-27a98c02d4c4"",
                            ""UrlEncodedKey"":""EAAAADHSjNg82gKW!2bII0kmO3Wd3bKBOAOJjW8Mb!2buKiNGhzr4ElEd4G4PGz7YHoRWqb4ozsiOr3A7mhzJw0VZg!2fD7RY!3d""
                         }
                      ],
                      ""Photo"":{
                         ""BinaryFileType"":{
                            ""Name"":""Person Image"",
                            ""Description"":""Image of a Person"",
                            ""IconCssClass"":""fa fa-camera"",
	                    },
                         ""IsTemporary"":false,
                         ""BinaryFileTypeId"":5,
                         ""Url"":null,
                         ""FileName"":""decker_ted.jpg"",
                         ""MimeType"":""image/jpeg"",
                         ""Description"":null,
                         ""StorageEntityTypeId"":51,
                         ""CreatedDateTime"":null,
                         ""ModifiedDateTime"":null,
                         ""CreatedByPersonAliasId"":null,
                         ""ModifiedByPersonAliasId"":null,
                         ""Attributes"":null,
                         ""AttributeValues"":null,
                         ""Id"":36,
                         ""Guid"":""5c875f30-7e0e-4d2f-a14b-51aa01e1d887"",
                         ""UrlEncodedKey"":""EAAAAGGE!2budoDA82FsBBemJhMyckBepZzs6zblCc0RNJ1j!2bjtnP!2bbzTTGDffFM7brwVOaM!2f6i0Aa2iyc6U1DyorqpIw!3d""
                      },
                      ""RecordStatusReasonValue"":null,
                      ""RecordStatusValue"":{
                         ""Order"":0,
                         ""Name"":""Active"",
                         ""Description"":""Denotes an individual that is actively participating in the activities or services of the organization."",
                         ""Id"":3,
                         ""Guid"":""618f906c-c33d-4fa3-8aef-e58cb7b63f1e"",
                         ""UrlEncodedKey"":""EAAAABP8y!2bgB9EHvyeR2Tr7miJ9SXQRqyr7lNsl98PUWXOqXclMLzmnQVRm8Msmz0!2f1FwMsTsNjPLz6t!2fy1GRuB!2fNl4!3d""
                      },
                      ""RecordTypeValue"":{
                         ""Order"":0,
                         ""Name"":""Person"",
                         ""Description"":""A Person Record"",
                         ""Id"":1,
                         ""Guid"":""36cf10d6-c695-413d-8e7c-4546efef385e"",
                         ""UrlEncodedKey"":""EAAAAPmuNdsg7fGQlwQdnyA7NVA3cihjY2nm9crF18A629Vz33FJ8p7SARghTWQ8YJ2D!2fY5g8xsLCk6ImNq3UUczuno!3d""
                      },
                      ""ReviewReasonValue"":null,
                      ""SuffixValue"":null,
                      ""TitleValue"":null,
                   }
                }
                </pre>


                </div>
                ");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "1B71FEF4-201F-4D53-8C60-2DF21F1985ED", "Campus", "Campus", "campus to post attendance to", 101, "76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8", "79E3B97B-A717-45AB-A279-335FCDEA141A");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "46A03F59-55D3-4ACE-ADD5-B4642225DD20", "Text Attendance Workflow", "WorkflowType", "The type of workflow to launch.", 3, "", "0097D00F-1F29-4217-8E67-D37A619A6FA3");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "73B02051-0D38-4AD9-BF81-A2D477DE4F70", "Workflow Attributes", "WorkflowAttributes", "Key/value list of workflow attributes to set with the given lava merge template. See the defined type’s help text for a listing of merge fields. <span class='tip tip-lava'></span>", 5, "", "836CFC0B-6750-4A93-8309-EAB868B845AF");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Workflow Name Template", "WorkflowNameTemplate", "The lava template to use for setting the workflow name. See the defined type's help text for a listing of merge fields. <span class='tip tip-lava'></span>", 4, "", "67E09C64-3558-48B7-9A27-A9499D0826E8");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Keyword Expression", "KeywordExpression", "", 2, "", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F");
            RockMigrationHelper.AddDefinedTypeAttribute("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "F4399CEF-827B-48B2-A735-F7806FCFE8E8", "AttendanceGroup", "AttendanceGroup", "The attendance group", 102, "7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e", "17B0E99E-2D10-442A-9342-1F9F07996C2B");
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF - Text Attendance Option (3) - Join a Homegroup", "3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF: Text Attendance Option (2) - Prayer Request", "2294DC3F-8539-4442-B30E-36D647C70261", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF: Text Attendance Option (4) - Review Contact Info", "FE137A19-ECCE-44B5-9643-00C056CF2A72", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF: Text Attendance Option (5) - Remove Last Attendance", "F3AE9577-2121-4971-BBED-CEBAB6AAF624", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF: Text Attendance Prayer Request Final", "63BE76F0-73E8-4709-8606-D26A5C060DCF", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "PF: Text in Attendance Option (1) - Check in Household", "BA83A4C4-1684-4755-BEEF-CE21E89A761B", false);
            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12082976885", "Post Falls WS - lifer####", "B4016741-F6B0-4E53-B0FB-BE05A8272F74", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"8722ac70-d178-4306-bf91-eb2fbb11dfa2");
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e");
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^2$");
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("2294DC3F-8539-4442-B30E-36D647C70261", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"ca876138-0461-40ad-ab4f-67678b8baeca");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^3.*");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF: Message for Joining a homegroup from {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("3F2C3A7B-FCBC-45DD-AA80-16BFAE4C6FE5", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ ReceivedDateTime }}|Campus^Post Falls Campus|");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"88978527-0ca4-4c52-8fda-cf915fafa472");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^2.+");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF: Prayer Request from {{ FromPerson.FullName }}");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("63BE76F0-73E8-4709-8606-D26A5C060DCF", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|MessageBody^{{MessageBody}}|");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"d8354ea7-7da9-449d-94ee-210c6b9496d8");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"a6978ce3-11ad-42fc-9df7-6a00c40b4797");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"(?i)lifer[0-9]...");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message from: {{ FromPerson.FullName }}");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("B4016741-F6B0-4E53-B0FB-BE05A8272F74", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{ FromPhone }}|ReceivedDateTime^{{ ReceivedDateTime}}|MessageBody^{{ MessageBody }}|ReceivedDate^{{ReceivedDate}}|ReceivedTime^{{ReceivedTime}}|Campus^Post Falls Campus|AttendanceGroup^Post Falls Worship Service|");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"c5fe671a-c3ca-4785-95dd-3cb10f4308b0");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"a6978ce3-11ad-42fc-9df7-6a00c40b4797");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^1.*");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("BA83A4C4-1684-4755-BEEF-CE21E89A761B", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|Campus^Post Falls Campus|AttendanceGroup^Post Falls Worship Service|");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"a74396b8-4723-4be7-9f4a-14506c921fc8");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^5.*");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("F3AE9577-2121-4971-BBED-CEBAB6AAF624", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"feb34437-9600-4330-855f-85404ec10018");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "17B0E99E-2D10-442A-9342-1F9F07996C2B", @"7105fcd2-3b66-4b6c-9ab6-4ce5fd572a1e");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^4.*");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "79E3B97B-A717-45AB-A279-335FCDEA141A", @"76882ae3-1ce8-42a6-a2b6-8c0b29cf8cf8");
            RockMigrationHelper.AddDefinedValueAttributeValue("FE137A19-ECCE-44B5-9643-00C056CF2A72", "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");

            // CDA Campus Defined Values
            Guid guidCDA = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA WS - lifer####", guidCDA.ToString(), false);
            Guid guidOption1 = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA: Text in Attendance Option (1) - Check in Household", guidOption1.ToString(), false);
            Guid guidOption2 = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA: Text Attendance Option (2) - Prayer Request", guidOption2.ToString(), false);
            Guid guidOption3 = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA - Text Attendance Option (3) - Join a Homegroup", guidOption3.ToString(), false);
            Guid guidOption4 = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA: Text Attendance Option (4) - Review Contact Info", guidOption4.ToString(), false);
            Guid guidOption5 = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA: Text Attendance Option (5) - Remove Last Attendance", guidOption5.ToString(), false);
            Guid guidOptionPR = Guid.NewGuid();

            RockMigrationHelper.AddDefinedValue("2CACB86F-D811-4483-98E1-272F1FF8FF5D", "+12084491990", "CDA: Text Attendance Prayer Request Final", guidOptionPR.ToString(), false);
            string rlmCDACampusGuid          = "84BE9A09-9E7D-4875-A3F9-C8949BC023BA";
            string rlmCDAAttendanceGroupGuid = "B47ED326-EB99-4A31-9E80-BA91B905B5E6";

            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"d8354ea7-7da9-449d-94ee-210c6b9496d8");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"(?i)lifer[0-9]...");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"CDA Message from: {{ FromPerson.FullName }}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidCDA.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{ FromPhone }}|ReceivedDateTime^{{ ReceivedDateTime}}|MessageBody^{{ MessageBody }}|ReceivedDate^{{ReceivedDate}}|ReceivedTime^{{ReceivedTime}}|Campus^Coeur d'Alene Campus|AttendanceGroup^RLM CDA Weekend Worship|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"c5fe671a-c3ca-4785-95dd-3cb10f4308b0");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^1.*");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption1.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|Campus^Coeur d'Alene Campus|AttendanceGroup^RLM CDA Weekend Worship|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"8722ac70-d178-4306-bf91-eb2fbb11dfa2");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^2$");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption2.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"88978527-0ca4-4c52-8fda-cf915fafa472");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^2.+");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF: Prayer Request from {{ FromPerson.FullName }}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOptionPR.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|MessageBody^{{MessageBody}}|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"ca876138-0461-40ad-ab4f-67678b8baeca");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^3.*");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF: Message for Joining a homegroup from {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption3.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ ReceivedDateTime }}|Campus^Coeur d'Alene Campus|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"feb34437-9600-4330-855f-85404ec10018");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^4.*");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption4.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");

            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "0097D00F-1F29-4217-8E67-D37A619A6FA3", @"a74396b8-4723-4be7-9f4a-14506c921fc8");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "17B0E99E-2D10-442A-9342-1F9F07996C2B", rlmCDAAttendanceGroupGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "3A526D6C-06FC-46CD-A447-9A6D9A74BB4F", @"^5.*");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "67E09C64-3558-48B7-9A27-A9499D0826E8", @"PF Message From: {{ FromPerson.FullName}}");
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "79E3B97B-A717-45AB-A279-335FCDEA141A", rlmCDACampusGuid);
            RockMigrationHelper.AddDefinedValueAttributeValue(guidOption5.ToString(), "836CFC0B-6750-4A93-8309-EAB868B845AF", @"FromPhone^{{FromPhone}}|ReceivedDateTime^{{ReceivedDateTime}}|MessageBody^{{MessageBody}}|");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Workflow", "Section Type", "Used by some components in Rock to control the styling used when building UI.", "A72D940B-2A69-44B8-931C-7FE99824D84C", @"");
            RockMigrationHelper.AddDefinedTypeAttribute("A72D940B-2A69-44B8-931C-7FE99824D84C", "9C204CD0-1233-41C5-818A-C5DA439445AA", "CSS Class", "CSSClass", "The CSS class that will be appended on the div element.", 2013, "", "967B5819-B712-4EEC-AA0A-BE0EE08A199A");
            RockMigrationHelper.AddAttributeQualifier("967B5819-B712-4EEC-AA0A-BE0EE08A199A", "ispassword", "False", "8D23E6CD-825E-410D-8049-E1D40ECBB7D9");
            RockMigrationHelper.AddAttributeQualifier("967B5819-B712-4EEC-AA0A-BE0EE08A199A", "maxcharacters", "", "3DD28B4B-2A60-4708-AB4F-E72C7BFFF971");
            RockMigrationHelper.AddAttributeQualifier("967B5819-B712-4EEC-AA0A-BE0EE08A199A", "showcountdown", "False", "A63B274F-75C0-4AA7-B4B0-59559831D70C");
            RockMigrationHelper.UpdateDefinedValue("A72D940B-2A69-44B8-931C-7FE99824D84C", "No Style", "No additional styling", "85CA07EE-6888-43FD-B8BF-24E4DD35C725", false);
            RockMigrationHelper.UpdateDefinedValue("A72D940B-2A69-44B8-931C-7FE99824D84C", "Well", "This will apply a 'well' with a muted background color and some padding.", "2D6369C1-3B39-4E94-8122-78C55A962C33", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("2D6369C1-3B39-4E94-8122-78C55A962C33", "967B5819-B712-4EEC-AA0A-BE0EE08A199A", @"well");

            CreateTable(
                "dbo.WorkflowActionFormSection",
                c => new
            {
                Id                         = c.Int(nullable: false, identity: true),
                Title                      = c.String(nullable: false, maxLength: 500),
                Description                = c.String(),
                ShowHeadingSeparator       = c.Boolean(nullable: false),
                SectionVisibilityRulesJSON = c.String(),
                Order                      = c.Int(nullable: false),
                WorkflowActionFormId       = c.Int(nullable: false),
                SectionTypeValueId         = c.Int(),
                CreatedDateTime            = c.DateTime(),
                ModifiedDateTime           = c.DateTime(),
                CreatedByPersonAliasId     = c.Int(),
                ModifiedByPersonAliasId    = c.Int(),
                Guid                       = c.Guid(nullable: false),
                ForeignId                  = c.Int(),
                ForeignGuid                = c.Guid(),
                ForeignKey                 = c.String(maxLength: 100),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .ForeignKey("dbo.DefinedValue", t => t.SectionTypeValueId)
            .ForeignKey("dbo.WorkflowActionForm", t => t.WorkflowActionFormId, cascadeDelete: true)
            .Index(t => t.WorkflowActionFormId)
            .Index(t => t.SectionTypeValueId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            CreateTable(
                "dbo.WorkflowFormBuilderTemplate",
                c => new
            {
                Id                            = c.Int(nullable: false, identity: true),
                Name                          = c.String(nullable: false, maxLength: 100),
                Description                   = c.String(),
                IsActive                      = c.Boolean(nullable: false),
                FormHeader                    = c.String(),
                FormFooter                    = c.String(),
                AllowPersonEntry              = c.Boolean(nullable: false),
                PersonEntrySettingsJson       = c.String(),
                ConfirmationEmailSettingsJson = c.String(),
                CompletionSettingsJson        = c.String(),
                IsLoginRequired               = c.Boolean(nullable: false),
                CreatedDateTime               = c.DateTime(),
                ModifiedDateTime              = c.DateTime(),
                CreatedByPersonAliasId        = c.Int(),
                ModifiedByPersonAliasId       = c.Int(),
                Guid                          = c.Guid(nullable: false),
                ForeignId                     = c.Int(),
                ForeignGuid                   = c.Guid(),
                ForeignKey                    = c.String(maxLength: 100),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            AddColumn("dbo.WorkflowType", "FormBuilderTemplateId", c => c.Int());
            AddColumn("dbo.WorkflowType", "IsFormBuilder", c => c.Boolean(nullable: false));
            AddColumn("dbo.WorkflowType", "FormBuilderSettingsJson", c => c.String());
            AddColumn("dbo.WorkflowType", "FormStartDateTime", c => c.DateTime());
            AddColumn("dbo.WorkflowType", "FormEndDateTime", c => c.DateTime());
            AddColumn("dbo.WorkflowType", "WorkflowExpireDateTime", c => c.DateTime());
            AddColumn("dbo.WorkflowType", "IsLoginRequired", c => c.Boolean(nullable: false));
            AddColumn("dbo.WorkflowActionFormAttribute", "ColumnSize", c => c.Int());
            AddColumn("dbo.WorkflowActionFormAttribute", "ActionFormSectionId", c => c.Int());
            CreateIndex("dbo.WorkflowType", "FormBuilderTemplateId");
            CreateIndex("dbo.WorkflowActionFormAttribute", "ActionFormSectionId");
            AddForeignKey("dbo.WorkflowActionFormAttribute", "ActionFormSectionId", "dbo.WorkflowActionFormSection", "Id");
            AddForeignKey("dbo.WorkflowType", "FormBuilderTemplateId", "dbo.WorkflowFormBuilderTemplate", "Id");
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            //Defined Types
            RockMigrationHelper.AddDefinedType("Financial", "Benevolence Request Status", "The status of a benevolence request.", "2787B088-D607-4D69-84FF-850A6891EE34", @"");
            RockMigrationHelper.AddDefinedType("Financial", "Benevolence Result Type", "The type of response given to a benevolence request.", "35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", @"");
            RockMigrationHelper.AddDefinedValue("2787B088-D607-4D69-84FF-850A6891EE34", "Pending", "", "67B24629-62A9-436A-A98C-30A454642153", false);
            RockMigrationHelper.AddDefinedValue("2787B088-D607-4D69-84FF-850A6891EE34", "Approved", "", "18D3A2DA-F2BA-49AE-83EB-7E60DCD18A3B", false);
            RockMigrationHelper.AddDefinedValue("2787B088-D607-4D69-84FF-850A6891EE34", "Denied", "", "3720671E-DA48-405F-A6D5-5E2D47436F9A", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Provided Financial Assistance", "", "4FEEDE75-0663-47E5-B1D0-A9639FAF197B", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Provided Gift Card", "", "78CE59CC-3E3B-47DE-8116-7B898319DE9E", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Provided Services", "", "C4C36847-0E86-4667-A28D-CB88D3BDEB7E", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Referred to Counseling", "", "43066522-55A2-4A2B-8340-17E927EC1B8D", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Referred to Food Pantry", "", "C70395A7-7F71-4F14-A599-BB4635ABFF2D", false);
            RockMigrationHelper.AddDefinedValue("35FC0225-3DAC-48B4-BDF7-AFDE104FB60E", "Unable to Make Contact", "", "CDF5D13E-4636-489C-85F9-95D42EF11895", false);

            //Model
            CreateTable(
                "dbo.BenevolenceRequest",
                c => new
            {
                Id        = c.Int(nullable: false, identity: true),
                FirstName = c.String(nullable: false, maxLength: 50),
                LastName  = c.String(nullable: false, maxLength: 50),
                Email     = c.String(maxLength: 254),
                RequestedByPersonAliasId = c.Int(),
                RequestText             = c.String(nullable: false),
                RequestDateTime         = c.DateTime(nullable: false),
                HomePhoneNumber         = c.String(),
                CellPhoneNumber         = c.String(),
                WorkPhoneNumber         = c.String(),
                CaseWorkerPersonAliasId = c.Int(),
                GovernmentId            = c.String(),
                RequestStatusValueId    = c.Int(nullable: false),
                ResultSummary           = c.String(),
                ConnectionStatusValueId = c.Int(),
                LocationId              = c.Int(),
                CreatedDateTime         = c.DateTime(),
                ModifiedDateTime        = c.DateTime(),
                CreatedByPersonAliasId  = c.Int(),
                ModifiedByPersonAliasId = c.Int(),
                Guid      = c.Guid(nullable: false),
                ForeignId = c.String(maxLength: 50),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.PersonAlias", t => t.CaseWorkerPersonAliasId)
            .ForeignKey("dbo.DefinedValue", t => t.ConnectionStatusValueId)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.Location", t => t.LocationId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.RequestedByPersonAliasId)
            .ForeignKey("dbo.DefinedValue", t => t.RequestStatusValueId)
            .Index(t => t.RequestedByPersonAliasId)
            .Index(t => t.CaseWorkerPersonAliasId)
            .Index(t => t.RequestStatusValueId)
            .Index(t => t.ConnectionStatusValueId)
            .Index(t => t.LocationId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            CreateTable(
                "dbo.BenevolenceResult",
                c => new
            {
                Id = c.Int(nullable: false, identity: true),
                BenevolenceRequestId = c.Int(nullable: false),
                ResultTypeValueId    = c.Int(nullable: false),
                Amount                  = c.Decimal(precision: 18, scale: 2),
                ResultSummary           = c.String(),
                CreatedDateTime         = c.DateTime(),
                ModifiedDateTime        = c.DateTime(),
                CreatedByPersonAliasId  = c.Int(),
                ModifiedByPersonAliasId = c.Int(),
                Guid      = c.Guid(nullable: false),
                ForeignId = c.String(maxLength: 50),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.BenevolenceRequest", t => t.BenevolenceRequestId)
            .ForeignKey("dbo.PersonAlias", t => t.CreatedByPersonAliasId)
            .ForeignKey("dbo.PersonAlias", t => t.ModifiedByPersonAliasId)
            .ForeignKey("dbo.DefinedValue", t => t.ResultTypeValueId)
            .Index(t => t.BenevolenceRequestId)
            .Index(t => t.ResultTypeValueId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            // Add Benevolence Blocks
            RockMigrationHelper.UpdateBlockType("Benevolence Request List", "Block used to list Benevolence Requests.", "~/Blocks/Finance/BenevolenceRequestList.ascx", "Finance", "3131C55A-8753-435F-85F3-DF777EFBD1C8");
            RockMigrationHelper.AddBlockTypeAttribute("3131C55A-8753-435F-85F3-DF777EFBD1C8", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "DetailPage", "", "", 0, @"", "E2C90243-A79A-4DAD-9301-07F6DF095CDB");
            RockMigrationHelper.AddBlockTypeAttribute("3131C55A-8753-435F-85F3-DF777EFBD1C8", "F4399CEF-827B-48B2-A735-F7806FCFE8E8", "Case Worker Group", "CaseWorkerGroup", "", "The group to draw case workers from", 0, @"26E7148C-2059-4F45-BCFE-32230A12F0DC", "576E31E0-EE40-4A89-93AE-5CCF1F45D21F");

            RockMigrationHelper.UpdateBlockType("Benevolence Request Detail", "Block for users to create, edit, and view benevolence requests.", "~/Blocks/Finance/BenevolenceRequestDetail.ascx", "Finance", "34275D0E-BC7E-4A9C-913E-623D086159A1");
            RockMigrationHelper.AddBlockTypeAttribute("34275D0E-BC7E-4A9C-913E-623D086159A1", "F4399CEF-827B-48B2-A735-F7806FCFE8E8", "Case Worker Group", "CaseWorkerGroup", "", "The group to draw case workers from", 0, @"26E7148C-2059-4F45-BCFE-32230A12F0DC", "89EA176C-2CEB-46F4-AACC-6AF55F5C42B0");
        }
Ejemplo n.º 22
0
        private void AddRockLogLevelDefinedValues()
        {
            RockMigrationHelper.AddDefinedType("System Settings",
                                               "Logging Domains",
                                               "Domains that can be logged.",
                                               Rock.SystemGuid.DefinedType.LOGGING_DOMAINS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "CMS",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_CMS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Event",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_EVENT);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Reporting",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_REPORTING);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Communications",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_COMMUNICATIONS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Finance",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_FINANCE);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Steps",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_STEPS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Connection",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_CONNECTION);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Group",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_GROUP);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Streaks",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_STREAKS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Core",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_CORE);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Jobs",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_JOBS);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Workflow",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_WORKFLOW);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "CRM",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_CRM);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Prayer",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_PRAYER);

            RockMigrationHelper.UpdateDefinedValue(
                Rock.SystemGuid.DefinedType.LOGGING_DOMAINS,
                "Other",
                string.Empty,
                Rock.SystemGuid.DefinedValue.LOGGING_DOMAIN_OTHER);
        }
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            // block and page
            RockMigrationHelper.AddBlockType("Shelby GL Export", "Lists all financial batches and provides Shelby GL Export capability", "~/Plugins/rocks_kfs/Finance/ShelbyGLExport.ascx", "KFS > Finance", "4A55A21B-F174-4012-AD6D-00BA9D76B1CA");
            RockMigrationHelper.AddPage(Rock.SystemGuid.Page.FUNCTIONS_FINANCE, "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Shelby GL Export", "", "408AAC12-B303-4565-AB97-0199F9F69A1B", "fa fa-archive", "EF65EFF2-99AC-4081-8E09-32A04518683A");
            RockMigrationHelper.AddBlock("408AAC12-B303-4565-AB97-0199F9F69A1B", "", "4A55A21B-F174-4012-AD6D-00BA9D76B1CA", "Shelby GL Export", "Main", "", "", 0, "7ED41FAE-BEE1-4307-AD4F-DEC77D455553");

            // project defined type
            RockMigrationHelper.AddDefinedType("Financial", "Financial Projects", "Used to designate what Project a Transaction should be associated with.", "1C9E0068-6840-4551-86F0-E12691CEC063");
            RockMigrationHelper.AddDefinedTypeAttribute("1C9E0068-6840-4551-86F0-E12691CEC063", Rock.SystemGuid.FieldType.TEXT, "GL Code", "Code", "", 0, "", "B85AA55C-ED3E-4E67-B022-81A7FC8C1E94");

            // batch export date
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialBatch", Rock.SystemGuid.FieldType.DATE_TIME, "", "", "Batch Exported", "", "Date a batch was exported", 0, "", "ADFC01F7-B446-479F-9BFE-30E3D68BCB83", "GLExport_BatchExported");
            RockMigrationHelper.AddAttributeQualifier("ADFC01F7-B446-479F-9BFE-30E3D68BCB83", "displayDiff", "False", "79D5F0E2-5A5F-46B6-B521-ADD2AB290ADB");
            RockMigrationHelper.AddAttributeQualifier("ADFC01F7-B446-479F-9BFE-30E3D68BCB83", "format", "", "06AC3DE6-BF7B-4DC4-AED4-9AFA5AB0A623");

            // transaction project
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialTransaction", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Transaction Project", "", "Designates the Project at the Financial Transaction Level", 0, "", "D15927A2-C163-4286-AC8E-5FD081E753FA", "Project");
            RockMigrationHelper.AddAttributeQualifier("D15927A2-C163-4286-AC8E-5FD081E753FA", "allowmultiple", "False", "E537D256-DD39-4324-982D-E9B71C6901F1");
            RockMigrationHelper.AddAttributeQualifier("D15927A2-C163-4286-AC8E-5FD081E753FA", "definedtype", "", "A50F2C57-32D8-4B34-8DFC-F2C47EBBFB4E");

            // transaction detail project
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialTransactionDetail", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Transaction Detail Project", "", "Designates the Project at the Financial Transaction Detail Level", 0, "", "C02C812E-AEEE-4D22-A13C-796558CD429D", "Project");
            RockMigrationHelper.AddAttributeQualifier("C02C812E-AEEE-4D22-A13C-796558CD429D", "allowmultiple", "False", "C02C812E-AEEE-4D22-A13C-796558CD429D");
            RockMigrationHelper.AddAttributeQualifier("C02C812E-AEEE-4D22-A13C-796558CD429D", "definedtype", "", "C02C812E-AEEE-4D22-A13C-796558CD429D");

            // account default project
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Default Project", "", "Designates the Project at the Financial Account Level", 0, "", "94E413D7-C6EB-4041-9E86-44269FFB9858", "Project");
            RockMigrationHelper.AddAttributeQualifier("94E413D7-C6EB-4041-9E86-44269FFB9858", "allowmultiple", "False", "518C3573-C2CB-4D10-BFD9-32A5E4D98CC5");
            RockMigrationHelper.AddAttributeQualifier("94E413D7-C6EB-4041-9E86-44269FFB9858", "definedtype", "", "6D84B878-66EC-462F-BC22-D9F2E41A4CF3");

            // set defined type qualifers
            Sql(@"
                DECLARE @ProjectDefinedTypeId int = ( SELECT TOP 1 [Id] FROM [DefinedType] WHERE [Guid] = '1C9E0068-6840-4551-86F0-E12691CEC063' )
                
                UPDATE [AttributeQualifier] SET [Value] = CAST( @ProjectDefinedTypeId AS varchar )
                WHERE [Guid] = 'A50F2C57-32D8-4B34-8DFC-F2C47EBBFB4E'

                UPDATE [AttributeQualifier] SET [Value] = CAST( @ProjectDefinedTypeId AS varchar )
                WHERE [Guid] = 'C02C812E-AEEE-4D22-A13C-796558CD429D'

                UPDATE [AttributeQualifier] SET [Value] = CAST( @ProjectDefinedTypeId AS varchar )
                WHERE [Guid] = '6D84B878-66EC-462F-BC22-D9F2E41A4CF3'

                UPDATE [Attribute] SET [IsGridColumn] = 1
                WHERE [Guid] = 'B85AA55C-ED3E-4E67-B022-81A7FC8C1E94'
            ");

            // account gl attributes
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Company", "", "", 1, "", "A6FBC708-AD97-4638-95B5-11E49B8277AF", "GeneralLedgerExport_Company");
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Fund", "", "", 2, "", "4F0D43CC-0EA7-4972-9ACA-F0849E892A16", "GeneralLedgerExport_Fund");
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Bank Account", "", "", 3, "", "C4B71AE6-6621-4A6C-9A8D-3F23CEA1EBF5", "GeneralLedgerExport_BankAccount");
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Revenue Department", "", "", 4, "", "1DB4ED40-7F7A-4A2C-A140-93B2909EB437", "GeneralLedgerExport_RevenueDepartment");
            RockMigrationHelper.AddEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Revenue Account", "", "", 5, "", "FF7119BC-8387-4F76-865A-2CA10C3BE308", "GeneralLedgerExport_RevenueAccount");

            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "GL Export", "fa fa-calculator", "", "7D825118-C581-41EA-933E-1FE194E0FC46");   // batch
            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "GL Export", "fa fa-calculator", "", "37CF80DC-1F95-4109-9359-30C424B62051");   // transaction
            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "GL Export", "fa fa-calculator", "", "E2885276-7F8B-4283-B8A4-933EBB4BD083");   // transaction detail
            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "GL Export", "fa fa-calculator", "", "8E7631B3-987E-4374-8697-EDEEC53B1AC4");   // account

            Sql(@"
                DECLARE @BatchEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = 'BDD09C8E-2C52-4D08-9062-BE7D52D190C2' )
                DECLARE @BatchCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = '7D825118-C581-41EA-933E-1FE194E0FC46' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @BatchEntityTypeId
                WHERE [Id] = @BatchCategoryId
                
                INSERT INTO [AttributeCategory]
                SELECT [Id], @BatchCategoryId
                FROM [Attribute]
                WHERE [Guid] = 'ADFC01F7-B446-479F-9BFE-30E3D68BCB83'


                DECLARE @TransactionEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = '2C1CB26B-AB22-42D0-8164-AEDEE0DAE667' )
                DECLARE @TransactionCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = '37CF80DC-1F95-4109-9359-30C424B62051' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @TransactionEntityTypeId
                WHERE [Id] = @TransactionCategoryId
                
                INSERT INTO [AttributeCategory]
                SELECT [Id], @TransactionCategoryId
                FROM [Attribute]
                WHERE [Guid] = 'D15927A2-C163-4286-AC8E-5FD081E753FA'


                DECLARE @TransactionDetailEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = 'AC4AC28B-8E7E-4D7E-85DB-DFFB4F3ADCCE' )
                DECLARE @TransactionDetailCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = 'E2885276-7F8B-4283-B8A4-933EBB4BD083' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @TransactionDetailEntityTypeId
                WHERE [Id] = @TransactionDetailCategoryId

                INSERT INTO [AttributeCategory]
                SELECT [Id], @TransactionDetailCategoryId
                FROM [Attribute]
                WHERE [Guid] = 'C02C812E-AEEE-4D22-A13C-796558CD429D'

                
                DECLARE @AccountEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = '798BCE48-6AA7-4983-9214-F9BCEFB4521D' )
                DECLARE @AccountCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = '8E7631B3-987E-4374-8697-EDEEC53B1AC4' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @AccountEntityTypeId
                WHERE [Id] = @AccountCategoryId

                INSERT INTO [AttributeCategory]
                SELECT [Id], @AccountCategoryId
                FROM [Attribute]
                WHERE [Guid] = '94E413D7-C6EB-4041-9E86-44269FFB9858'
                   OR [Guid] = 'A6FBC708-AD97-4638-95B5-11E49B8277AF'
                   OR [Guid] = '4F0D43CC-0EA7-4972-9ACA-F0849E892A16'
                   OR [Guid] = 'C4B71AE6-6621-4A6C-9A8D-3F23CEA1EBF5'
                   OR [Guid] = '1DB4ED40-7F7A-4A2C-A140-93B2909EB437'
                   OR [Guid] = 'FF7119BC-8387-4F76-865A-2CA10C3BE308'
            ");
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // update the index rebuilder
            Sql(MigrationSQL._201707171725146_UniversalSearchPages_spDbaRebuildIndexes);

            // add pages for api docs
            RockMigrationHelper.AddPage("7F1F4130-CB98-473B-9DE1-7A886D2283ED", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "API Docs", "", "C132F1D5-9F43-4AEB-9172-CD45138B4CEA", "fa fa-diamond");   // Site:Rock RMS
            // Add Block to Page: API Docs, Site: Rock RMS
            RockMigrationHelper.AddBlock("C132F1D5-9F43-4AEB-9172-CD45138B4CEA", "", "B97FB779-5D3E-4663-B3B5-3C2C227AE14A", "Redirect", "Main", @"", @"", 0, "ECB741BB-E4E8-4029-B83E-2FCC2D95ABE4");
            // Attrib for BlockType: Redirect:Redirect When
            RockMigrationHelper.UpdateBlockTypeAttribute("B97FB779-5D3E-4663-B3B5-3C2C227AE14A", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Redirect When", "RedirectWhen", "", "When the redirect will occur.", 1, @"1", "F09F2F0C-9FB0-4BC2-818C-FAD25900CF26");
            // Attrib for BlockType: Redirect:Network
            RockMigrationHelper.UpdateBlockTypeAttribute("B97FB779-5D3E-4663-B3B5-3C2C227AE14A", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Network", "Network", "", "The network to compare to in the format of '192.168.0.0/24'. See http://www.ipaddressguide.com/cidr for assistance in calculating CIDR addresses.", 2, @"", "1A584473-9E6B-4DB1-A4E2-78B62CEBBDC4");
            // Attrib Value for Block:Redirect, Attribute:Redirect When Page: API Docs, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("ECB741BB-E4E8-4029-B83E-2FCC2D95ABE4", "F09F2F0C-9FB0-4BC2-818C-FAD25900CF26", @"1");
            // Attrib Value for Block:Redirect, Attribute:Network Page: API Docs, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("ECB741BB-E4E8-4029-B83E-2FCC2D95ABE4", "1A584473-9E6B-4DB1-A4E2-78B62CEBBDC4", @"");
            // Attrib Value for Block:Redirect, Attribute:Url Page: API Docs, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("ECB741BB-E4E8-4029-B83E-2FCC2D95ABE4", "964D33F4-27D0-4715-86BE-D30CEB895044", @"/api/docs");

            RockMigrationHelper.AddSecurityAuthForBlock("ECB741BB-E4E8-4029-B83E-2FCC2D95ABE4", 0, Authorization.ADMINISTRATE, false, null, Model.SpecialRole.AllUsers, "3FC5ECB8-6066-8CB8-42D0-15D9DA8D4427");

            // set attribute on universal search search component
            RockMigrationHelper.UpdateEntityType("Rock.Search.Other.Universal", "Universal", "Rock.Search.Other.Universal, Rock, Version=1.7.0.33, Culture=neutral, PublicKeyToken=null", false, true, "BD0FAAC1-2313-4D36-8B78-268715320F02");

            Sql(@"DECLARE @AttributeId int = 0
DECLARE @EntityTypeId int = (SELECT TOP 1 [Id] FROM [EntityType] WHERE [Name] = 'Rock.Search.Other.Universal')
DECLARE @TextFieldTypeId int = (SELECT TOP 1 [Id] FROM [FieldType] WHERE [Guid] = '9C204CD0-1233-41C5-818A-C5DA439445AA')
IF EXISTS (SELECT TOP 1 * FROM [Attribute] a
		INNER JOIN [EntityType] e ON e.[Id] = a.[EntityTypeId]
		WHERE e.[Name] = 'Rock.Search.Other.Universal' AND a.[Key] = 'ResultURL')
	BEGIN
		SELECT @AttributeId = (SELECT TOP 1 a.[Id] FROM [Attribute] a
		INNER JOIN [EntityType] e ON e.[Id] = a.[EntityTypeId]
		WHERE e.[Name] = 'Rock.Search.Other.Universal' AND a.[Key] = 'ResultURL')
	END
ELSE
	BEGIN
		INSERT INTO [Attribute] ([IsSystem], [FieldTypeId], [EntityTypeId], [Key], [Name], [Description], [Order], [IsGridColumn],[IsMultiValue], [IsRequired], [Guid], [AllowSearch], [IsIndexEnabled], [IsAnalytic], [IsAnalyticHistory])
		VALUES (0,@TextFieldTypeId, @EntityTypeId, 'ResultURL', 'Result URL', 'The url to redirect user to after they have entered search text.  (use ''{0}'' for the search text)', 1,0,0,1,'537CE5A5-7B05-569E-48BE-EA38A12EBA7A', 0,0,0,0)
	
		SET @AttributeId = SCOPE_IDENTITY()
	END

IF EXISTS (SELECT * FROM [AttributeValue] WHERE [AttributeId] = @AttributeId)
	BEGIN
		UPDATE [AttributeValue]
			SET [Value] = 'universalsearch/{0}?SmartSearch=true'
		WHERE [AttributeId] = @AttributeId
	END
ELSE
	BEGIN
		INSERT INTO [AttributeValue] ([IsSystem], [EntityId], [AttributeId], [Value], [Guid])
		VALUES
		(0, 0, @AttributeId, 'universalsearch/{0}?SmartSearch=true', 'A48B694E-28CF-268B-4EAB-907114EC9F70')
	END"    );

            // pages for universal search
            RockMigrationHelper.AddPage("936C90C4-29CF-4665-A489-7C687217F7B8", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Universal Search", "", "B07F30B3-95C4-40A5-9CF6-455399BEF67A", "fa fa-search"); // Site:Rock RMS
            RockMigrationHelper.AddPageRoute("B07F30B3-95C4-40A5-9CF6-455399BEF67A", "universalsearch/{Q}", "69B00D34-9E70-4451-8EB8-955B32926380");                                                     // for Page:Universal Search
            RockMigrationHelper.AddPageRoute("B07F30B3-95C4-40A5-9CF6-455399BEF67A", "universalsearch/{DocumentType}/{DocumentId}", "2AB19664-0B4A-4846-A4EE-316BC0D2DD10");                             // for Page:Universal Search
            RockMigrationHelper.AddPageRoute("B07F30B3-95C4-40A5-9CF6-455399BEF67A", "universalsearch", "43CAE944-6358-423A-8A12-5F2AE26DAAC4");                                                         // for Page:Universal Search

            RockMigrationHelper.UpdateBlockType("Entity Attribute Values", "View and edit attribute values for an entity.", "~/Blocks/Utility/EntityAttributeValues.ascx", "Utility", "4A89FF55-A6A3-4A9B-8D1D-2ADE092565F5");
            // Add Block to Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlock("B07F30B3-95C4-40A5-9CF6-455399BEF67A", "", "FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "Universal Search", "Main", @"", @"", 0, "309A2477-9A5B-4FD4-A722-735F87861A05");
            // Attrib for BlockType: Universal Search:Use Custom Results
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Use Custom Results", "UseCustomResults", "", "Determines if the custom results should be displayed.", 0, @"False", "45F64F50-A41C-4247-B0FF-655520B6AC97");
            // Attrib for BlockType: Universal Search:Search Type
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Search Type", "SearchType", "", "The type of search to perform.", 0, @"0", "152FA041-3DA7-4BA4-A2D5-87BFA1618536");
            // Attrib for BlockType: Universal Search:Search Input Post-HTML
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Search Input Post-HTML", "PostHtml", "", "Custom Lava to place after the search input (for styling).", 0, @"", "8F8CDF58-C491-4DB7-AE41-2AC91AE77270");
            // Attrib for BlockType: Universal Search:Show Filters
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Filters", "ShowFilters", "", "Toggles the display of the model filter which allows the user to select which models to search on.", 0, @"True", "8BCE3DFD-B91D-4962-8F5B-B0E56C5CA34B");
            // Attrib for BlockType: Universal Search:Enabled Models
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Enabled Models", "EnabledModels", "", "The models that should be enabled for searching.", 0, @"", "4B5C7A21-E5C8-4954-93A4-063CE1A9EB9C");
            // Attrib for BlockType: Universal Search:Results Per Page
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Results Per Page", "ResultsPerPage", "", "The number of results to show per page.", 0, @"20", "026E7BDE-ED30-42A8-824A-420B649EEFA2");
            // Attrib for BlockType: Universal Search:Base Field Filters
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Base Field Filters", "BaseFieldFilters", "", "These field filters will always be enabled and will not be changeable by the individual. Uses tha same syntax as the lava command.", 0, @"", "C3DFA7F1-29F0-4D56-91F4-2C41906AB972");
            // Attrib for BlockType: Universal Search:Show Refined Search
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Refined Search", "ShowRefinedSearch", "", "Determines whether the refinded search should be shown.", 0, @"True", "565A7DF1-FE40-432B-B912-25E8CDDAC318");
            // Attrib for BlockType: Universal Search:Show Scores
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Scores", "ShowScores", "", "Enables the display of scores for help with debugging.", 0, @"False", "87CB8916-A2D4-443D-8EF4-DA5ABDB367D0");
            // Attrib for BlockType: Universal Search:Lava Result Template
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Lava Result Template", "LavaResultTemplate", "", "Custom Lava results template to use instead of the standard results.", 0, @"<ul>{% for result in Results %}      <li><i class='fa {{ result.IconCssClass }}'></i> {{ result.DocumentName }} <small>(Score {{ result.Score }} )</small> </li>  {% endfor %}</ul>", "0FC1B4E2-A470-49B4-A08A-67D477D0B3B6");
            // Attrib for BlockType: Universal Search:Custom Results Commands
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "4BD9088F-5CC6-89B1-45FC-A2AAFFC7CC0D", "Custom Results Commands", "CustomResultsCommands", "", "The custom Lava fields to allow.", 0, @"", "09A3947F-E3C5-417F-8299-C75BC580D0FC");
            // Attrib for BlockType: Universal Search:Search Input Pre-HTML
            RockMigrationHelper.UpdateBlockTypeAttribute("FDF1BBFF-7A7B-4F4E-BF34-831203B0FEAC", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Search Input Pre-HTML", "PreHtml", "", "Custom Lava to place before the search input (for styling).", 0, @"", "84E0262A-55F1-46EA-A3E4-EFE40A8504DE");
            // Attrib Value for Block:Universal Search, Attribute:Use Custom Results Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "45F64F50-A41C-4247-B0FF-655520B6AC97", @"False");
            // Attrib Value for Block:Universal Search, Attribute:Search Type Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "152FA041-3DA7-4BA4-A2D5-87BFA1618536", @"2");
            // Attrib Value for Block:Universal Search, Attribute:Search Input Post-HTML Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "8F8CDF58-C491-4DB7-AE41-2AC91AE77270", @"");
            // Attrib Value for Block:Universal Search, Attribute:Show Filters Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "8BCE3DFD-B91D-4962-8F5B-B0E56C5CA34B", @"True");
            // Attrib Value for Block:Universal Search, Attribute:Enabled Models Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "4B5C7A21-E5C8-4954-93A4-063CE1A9EB9C", @"208,16,15");
            // Attrib Value for Block:Universal Search, Attribute:Results Per Page Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "026E7BDE-ED30-42A8-824A-420B649EEFA2", @"20");
            // Attrib Value for Block:Universal Search, Attribute:Base Field Filters Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "C3DFA7F1-29F0-4D56-91F4-2C41906AB972", @"");
            // Attrib Value for Block:Universal Search, Attribute:Show Refined Search Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "565A7DF1-FE40-432B-B912-25E8CDDAC318", @"True");
            // Attrib Value for Block:Universal Search, Attribute:Show Scores Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "87CB8916-A2D4-443D-8EF4-DA5ABDB367D0", @"False");
            // Attrib Value for Block:Universal Search, Attribute:Lava Result Template Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "0FC1B4E2-A470-49B4-A08A-67D477D0B3B6", @"<ul>{% for result in Results %}     <li><i class='fa {{ result.IconCssClass }}'></i> {{ result.DocumentName }} <small>(Score {{ result.Score }} )</small> </li> {% endfor %}</ul>");
            // Attrib Value for Block:Universal Search, Attribute:Custom Results Commands Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "09A3947F-E3C5-417F-8299-C75BC580D0FC", @"");
            // Attrib Value for Block:Universal Search, Attribute:Search Input Pre-HTML Page: Universal Search, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("309A2477-9A5B-4FD4-A722-735F87861A05", "84E0262A-55F1-46EA-A3E4-EFE40A8504DE", @"");


            // add lava webhook
            RockMigrationHelper.AddDefinedType("Global", "Lava Webhook", "Webhook to process pre-defined Lava in response to incoming requests. ", SystemGuid.DefinedType.WEBHOOK_TO_LAVA, @"The following merge fields are available for the ''Template'' attribute.

<p>
    <a data-toggle=""collapse"" href=""#collapsefields"" class=""btn btn-action btn-xs"">show/hide fields</a>
</p>

<div id=""collapsefields"" class=""panel-collapse collapse"">
<pre>
{
  ""Url"": ""/test"",
  ""RawUrl"": ""http://localhost:6229/Webhooks/LavaApi.ashx/test?queryParameter=true"",
  ""Method"": ""POST"",
  ""QueryString"": {
    ""queryParameter"": ""true""
  },
  ""RemoteAddress"": ""127.0.0.1"",
  ""RemoteName"": ""127.0.0.1"",
  ""ServerName"": ""localhost"",
  ""RawBody"": ""{""key1"":""value1"", ""key2"":""value2""}"",
  ""Body"": {
    ""key1"": ""value1"",
    ""key2"": ""value2""
  },
  ""Headers"": {
    ""Content-Length"": ""34"",
    ""Content-Type"": ""application/json"",
    ""Accept"": ""*/*"",
    ""Host"": ""localhost:6229"",
    ""User-Agent"": ""curl/7.35.0""
  },
  ""Cookies"": {
    ""sessionToken"": ""abc123""
  }
}
</pre>
</div>");

            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.WEBHOOK_TO_LAVA, SystemGuid.FieldType.SINGLE_SELECT, "Method", "Method", "The HTTP Verb to match against. Leave blank to match all verbs.", 1, "", "d9c92cdb-70ab-4d99-b580-eb55ed9fbee0");
            RockMigrationHelper.AddAttributeQualifier("d9c92cdb-70ab-4d99-b580-eb55ed9fbee0", "fieldtype", "ddl", "6939b529-7fcf-49f9-9c37-3a8a1e7af7a3");
            RockMigrationHelper.AddAttributeQualifier("d9c92cdb-70ab-4d99-b580-eb55ed9fbee0", "values", "GET,POST,PUT,PATCH,DELETE", "461cfb14-4a2a-4662-98df-89ea7478627a");

            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.WEBHOOK_TO_LAVA, SystemGuid.FieldType.CODE_EDITOR, "Template", "Template", "The lava script to use when processing this request. <span class='tip tip-lava'></span>", 2, "", "4303ae08-2208-4f46-9b98-fd91a710ce1e");
            RockMigrationHelper.AddAttributeQualifier("4303ae08-2208-4f46-9b98-fd91a710ce1e", "editorHeight", "300", "c65b2e5a-27fd-4096-ab6c-cc58289d1258");
            RockMigrationHelper.AddAttributeQualifier("4303ae08-2208-4f46-9b98-fd91a710ce1e", "editorMode", Rock.Web.UI.Controls.CodeEditorMode.Lava.ConvertToInt().ToString(), "4d987d2e-4584-436f-9e5c-ed18d87af827");
            RockMigrationHelper.AddAttributeQualifier("4303ae08-2208-4f46-9b98-fd91a710ce1e", "editorTheme", Rock.Web.UI.Controls.CodeEditorTheme.Rock.ConvertToInt().ToString(), "f46b6509-2ef7-4283-b4fd-dd899de65832");

            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.WEBHOOK_TO_LAVA, SystemGuid.FieldType.LAVA_COMMANDS, "Enabled Lava Commands", "EnabledLavaCommands", "Which lava commands are available to be used by the lava template", 3, "", "2df9f53d-926e-4d2a-b755-818edd933781");

            RockMigrationHelper.AddDefinedTypeAttribute(SystemGuid.DefinedType.WEBHOOK_TO_LAVA, SystemGuid.FieldType.TEXT, "Response Content Type", "ResponseContentType", "The Content-Type header to include in the response. If no value is provided then 'text/plain' is used. Common values are 'application/json' and 'application/xml'.", 4, "", "73774e76-028f-445c-a078-bfb8885a102c");
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // #897 Binary File Types Duplicate Name rollups
            DropIndex("dbo.BinaryFileType", new[] { "Name" });

            // #893 Office Information orphan block removal
            RockMigrationHelper.DeleteBlock("3BFEF2CC-AEA9-457E-A552-C14D69AD93FE");

            //
            // add defined type for registration configuration
            //

            RockMigrationHelper.AddDefinedType("Check-in", "Family Registration Configuration", "Configuration templates for the Family Registration application.", "0F48CB3F-8A48-249A-412A-2DCA7648706F");
            RockMigrationHelper.AddDefinedTypeAttribute("0F48CB3F-8A48-249A-412A-2DCA7648706F", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Configuration Template", "ConfigurationTemplate", "JSON configuration file.", 0, "", "492D1E2D-5DB5-53BF-46BF-C1F95D17A72B");
            RockMigrationHelper.AddAttributeQualifier("492D1E2D-5DB5-53BF-46BF-C1F95D17A72B", "editorHeight", "600", "8A687566-5E0C-5C9B-4A95-CAE04EF4F947");
            RockMigrationHelper.AddAttributeQualifier("492D1E2D-5DB5-53BF-46BF-C1F95D17A72B", "editorTheme", "0", "3E912DED-21A6-9398-4BC3-DC44EA3249A5");
            RockMigrationHelper.AddAttributeQualifier("492D1E2D-5DB5-53BF-46BF-C1F95D17A72B", "editorMode", "4", "C557305C-84DD-5191-4A9B-C873A487AD05");

            //
            // pages for calendar
            //

            RockMigrationHelper.AddPage("F7105BFE-B28C-41B6-9CE6-F1018D77DD8F", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Calendars", "", "63990874-0DFF-45FC-9F09-81B0B0D375B4", ""); // Site:Rock RMS
            RockMigrationHelper.UpdateBlockType("Event Calendar List", "Block to display the event calendars.", "~/Blocks/Calendar/EventCalendarList.ascx", "Event Calendar", "041B5C23-5F1F-4B02-A767-FB7F4B1A5345");
            RockMigrationHelper.AddBlock("63990874-0DFF-45FC-9F09-81B0B0D375B4", "", "041B5C23-5F1F-4B02-A767-FB7F4B1A5345", "Event Calendar List", "Main", "", "", 0, "367B36C6-2779-451D-BF8C-BC6318D42AA1");

            RockMigrationHelper.AddBlockTypeAttribute("041B5C23-5F1F-4B02-A767-FB7F4B1A5345", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "DetailPage", "", "Page used to view status of an event calendar.", 0, @"", "E7907FA7-B586-439B-8DE1-C0185EC4F790");

            RockMigrationHelper.AddBlockAttributeValue("367B36C6-2779-451D-BF8C-BC6318D42AA1", "E7907FA7-B586-439B-8DE1-C0185EC4F790", @"b54725e1-3640-4419-b580-2af77daf6568"); // Detail Page

            // Page: Event Calendar Detail
            RockMigrationHelper.AddPage("63990874-0DFF-45FC-9F09-81B0B0D375B4", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Event Calendar Detail", "", "B54725E1-3640-4419-B580-2AF77DAF6568", ""); // Site:Rock RMS
            RockMigrationHelper.UpdateBlockType("Event Calendar Detail", "Displays the details of the given Event Calendar for editing.", "~/Blocks/Calendar/EventCalendarDetail.ascx", "Event Calendar", "0320DFB9-7A5A-4DAC-8234-3D504E496D71");
            RockMigrationHelper.UpdateBlockType("Event Calendar Item List", "Lists all the items in the given calendar.", "~/Blocks/Calendar/EventCalendarItemList.ascx", "Event Calendar", "EC8DFDC5-C177-4208-8ABA-1F85010FBBFF");
            RockMigrationHelper.AddBlock("B54725E1-3640-4419-B580-2AF77DAF6568", "", "0320DFB9-7A5A-4DAC-8234-3D504E496D71", "Event Calendar Detail", "Main", "", "", 0, "0C94B3DE-4FA8-4683-B4E9-52BE40D266D9");

            RockMigrationHelper.AddBlock("B54725E1-3640-4419-B580-2AF77DAF6568", "", "EC8DFDC5-C177-4208-8ABA-1F85010FBBFF", "Event Calendar Item List", "Main", "", "", 1, "87D0A3C6-D32B-4840-8D1A-B6030B72EA95");

            RockMigrationHelper.AddBlockTypeAttribute("EC8DFDC5-C177-4208-8ABA-1F85010FBBFF", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "DetailPage", "", "", 0, @"", "AA08DCED-940E-45B9-AB9B-7B93A609BF13");

            RockMigrationHelper.AddBlockAttributeValue("87D0A3C6-D32B-4840-8D1A-B6030B72EA95", "AA08DCED-940E-45B9-AB9B-7B93A609BF13", @"7fb33834-f40a-4221-8849-bb8c06903b04"); // Detail Page

            // Page: Event Item Detail Page
            RockMigrationHelper.AddPage("B54725E1-3640-4419-B580-2AF77DAF6568", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Event Item Detail Page", "", "7FB33834-F40A-4221-8849-BB8C06903B04", ""); // Site:Rock RMS
            RockMigrationHelper.UpdateBlockType("Event Item Detail", "Displays the details of the given eventItem.", "~/Blocks/Calendar/EventItemDetail.ascx", "Event Calendar", "39E3476D-1BA1-438D-887F-03DD23639221");
            RockMigrationHelper.AddBlock("7FB33834-F40A-4221-8849-BB8C06903B04", "", "39E3476D-1BA1-438D-887F-03DD23639221", "Event Item Detail", "Main", "", "", 0, "2F577D8E-7A9C-46DC-A4AB-4732E217F7D0");

            RockMigrationHelper.AddBlockTypeAttribute("39E3476D-1BA1-438D-887F-03DD23639221", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Edit", "ShowEdit", "", "", 2, @"True", "95CB7E85-F83D-47BB-84B3-77A73C640304");
            // Page: Calendar
            RockMigrationHelper.AddPage("85F25819-E948-4960-9DDF-00F54D32444E", "5FEAF34C-7FB6-4A11-8A1E-C452EC7849BD", "Calendar", "", "2E6FED28-683F-4726-8CF1-2822E8E73B03", ""); // Site:External Website
            RockMigrationHelper.UpdateBlockType("Event Calendar Lava", "Displays details for a specific package.", "~/Blocks/Calendar/ExternalCalendarLava.ascx", "Event Calendar", "8760D668-8ADF-48C8-9D90-09461FB75B88");
            RockMigrationHelper.AddBlock("2E6FED28-683F-4726-8CF1-2822E8E73B03", "", "8760D668-8ADF-48C8-9D90-09461FB75B88", "Event Calendar Lava", "Main", "", "", 0, "0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Set Page Title", "SetPageTitle", "", "Determines if the block should set the page title with the calendar name.", 0, @"False", "4A53E8C5-EE4E-4321-9226-3EEA32A9379D");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Event Calendar Id", "EventCalendarId", "", "The Id of the event calendar to be displayed", 0, @"1", "BF06F16A-E40F-497A-B1A9-409D4FFCD972");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Date Range Filter", "ShowDateRangeFilter", "", "Determines whether the campus filters are shown", 0, @"False", "C1259B83-C1AF-4880-81A3-16204D502DC9");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Category Filter", "ShowCategoryFilter", "", "Determines whether the campus filters are shown", 0, @"False", "9DEA73E9-E5AF-4386-BFBA-4C1440D315C8");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Campus Filter", "ShowCampusFilter", "", "Determines whether the campus filters are shown", 0, @"False", "0DA63111-AFE3-4D77-BE00-05DE5D69B536");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Lava Template", "LavaTemplate", "", "Lava template to use to display the list of events.", 2, @"{% include '~/Assets/Lava/EventCalendar/ExternalCalendar.lava' %}", "1D3EC083-581E-4435-8FC8-930C48AC50F4");

            RockMigrationHelper.AddBlockTypeAttribute("8760D668-8ADF-48C8-9D90-09461FB75B88", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enable Debug", "EnableDebug", "", "Display a list of merge fields available for lava.", 3, @"False", "1704176B-F79A-4586-8B11-8460CCFB44BE");

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "1D3EC083-581E-4435-8FC8-930C48AC50F4", @"{% include '~/Assets/Lava/EventCalendar/ExternalCalendar.lava' %}"); // Lava Template

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "1704176B-F79A-4586-8B11-8460CCFB44BE", @"False");                                                             // Enable Debug

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "4A53E8C5-EE4E-4321-9226-3EEA32A9379D", @"False");                                                             // Set Page Title

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "BF06F16A-E40F-497A-B1A9-409D4FFCD972", @"1");                                                                 // Event Calendar Id

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "C1259B83-C1AF-4880-81A3-16204D502DC9", @"False");                                                             // Show Date Range Filter

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "9DEA73E9-E5AF-4386-BFBA-4C1440D315C8", @"False");                                                             // Show Category Filter

            RockMigrationHelper.AddBlockAttributeValue("0ADEEFE5-8293-48AC-AFA9-E0F0E363FCE7", "0DA63111-AFE3-4D77-BE00-05DE5D69B536", @"False");                                                             // Show Campus Filter


            Sql(@"
    INSERT INTO [dbo].[EventCalendar]
           ([Name]
           ,[Description]
           ,[IconCssClass]
           ,[IsActive]
           ,[Guid])
     VALUES
           ('Public'
           ,'A calendar for public events that the church hosts and promotes.'
           ,'fa fa-calendar'
           ,'true'
           ,'8a444668-19af-4417-9c74-09f842572974')
");
        }
Ejemplo n.º 26
0
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            // project defined type
            RockMigrationHelper.AddDefinedType("Financial", "Financial Edge Projects", "Used to designate what Project a Transaction should be associated with. Value: Journal Id, Description: Friendly Name", "35178732-932A-472F-8D39-526B8E45625E");

            // reset the batch export date attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'DateExported'
                WHERE [Guid] = '16EFE0B4-E607-4960-BC92-8D66854E827A'
            ");

            // batch export date
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.FinancialBatch", Rock.SystemGuid.FieldType.DATE_TIME, "", "", "Date Exported", "Date the batch was exported to Financial Edge.", 0, "", "16EFE0B4-E607-4960-BC92-8D66854E827A");
            RockMigrationHelper.UpdateAttributeQualifier("16EFE0B4-E607-4960-BC92-8D66854E827A", "displayDiff", "False", "B707D9D4-1697-42A2-985A-CCFC93414365");
            RockMigrationHelper.UpdateAttributeQualifier("16EFE0B4-E607-4960-BC92-8D66854E827A", "format", "", "F0326D79-8C42-4D16-9E71-1E03DA0B1711");

            // set the batch export date attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'rocks.kfs.FinancialEdge.DateExported'
                WHERE [Guid] = '16EFE0B4-E607-4960-BC92-8D66854E827A'
            ");

            // reset the transaction detail project attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'TransactionDetailProject'
                WHERE [Guid] = '0450CE22-2C04-453F-B688-5FC687FA59B0'
            ");

            // transaction detail project
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.FinancialTransactionDetail", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Transaction Detail Project", "Designates the Project at the Financial Transaction Detail Level", 0, "", "0450CE22-2C04-453F-B688-5FC687FA59B0");
            RockMigrationHelper.UpdateAttributeQualifier("0450CE22-2C04-453F-B688-5FC687FA59B0", "allowmultiple", "False", "66C3ED8D-59EA-4013-80C9-7262FBEB8ADF");
            RockMigrationHelper.UpdateAttributeQualifier("0450CE22-2C04-453F-B688-5FC687FA59B0", "definedtype", "", "242EF4D2-0F55-481D-9065-A642E65736DE");
            RockMigrationHelper.UpdateAttributeQualifier("0450CE22-2C04-453F-B688-5FC687FA59B0", "displaydescription", "True", "6ED65431-6151-438F-BB7A-AC4AE953D08D");
            RockMigrationHelper.UpdateAttributeQualifier("0450CE22-2C04-453F-B688-5FC687FA59B0", "enhancedselection", "True", "DDE8F66C-15C5-44A1-90BD-87D5BE3FD6FC");

            // set the transaction detail project attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'rocks.kfs.FinancialEdge.PROJECTID'
                WHERE [Guid] = '0450CE22-2C04-453F-B688-5FC687FA59B0'
            ");

            // reset the credit account attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'CreditAccount'
                WHERE [Guid] = '82688734-FEAF-48B2-9948-80EA225EC938'
            ");

            // reset the debit account attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'DebitAccount'
                WHERE [Guid] = '0726BE0F-0B41-4FB5-A3CC-352B2B46A2CD'
            ");

            // account gl attributes
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Credit Account", "Account number to use for credit column. Required by FE.", 1, "", "82688734-FEAF-48B2-9948-80EA225EC938");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.TEXT, "", "", "Debit Account", "Account number to use for debit column. Required by FE.", 2, "", "0726BE0F-0B41-4FB5-A3CC-352B2B46A2CD");

            // set the credit account attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'rocks.kfs.FinancialEdge.ACCOUNTNO'
                WHERE [Guid] = '82688734-FEAF-48B2-9948-80EA225EC938'
            ");

            // set the debit account attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'rocks.kfs.FinancialEdge.DEBITACCOUNTNO'
                WHERE [Guid] = '0726BE0F-0B41-4FB5-A3CC-352B2B46A2CD'
            ");

            // reset the account project attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'DefaultProject'
                WHERE [Guid] = '8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC'
            ");

            // account project
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.FinancialAccount", Rock.SystemGuid.FieldType.DEFINED_VALUE, "", "", "Default Project", "Designates the Project at the Financial Account Level", 0, "", "8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC");
            RockMigrationHelper.UpdateAttributeQualifier("8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC", "allowmultiple", "False", "5DB1B3FA-5A9E-4DCA-8730-7922838EF21F");
            RockMigrationHelper.UpdateAttributeQualifier("8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC", "definedtype", "", "E5635789-1F3D-4EE5-9230-80A61FC3788C");
            RockMigrationHelper.UpdateAttributeQualifier("8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC", "displaydescription", "True", "29A2EC92-E6E5-4399-8C89-B206264C6ABB");
            RockMigrationHelper.UpdateAttributeQualifier("8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC", "enhancedselection", "True", "C945C6C0-81AE-4C8E-A08D-210C61B7AC06");

            // reset the account project attribute key
            Sql(@"
                UPDATE [Attribute]
                SET [Key] = 'rocks.kfs.FinancialEdge.PROJECTID'
                WHERE [Guid] = '8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC'
            ");

            // set defined type qualifers
            Sql(@"
                DECLARE @ProjectDefinedTypeId int = ( SELECT TOP 1 [Id] FROM [DefinedType] WHERE [Guid] = '35178732-932A-472F-8D39-526B8E45625E' )

                UPDATE [AttributeQualifier] SET [Value] = CAST( @ProjectDefinedTypeId AS varchar )
                WHERE [Guid] = '242EF4D2-0F55-481D-9065-A642E65736DE'

                UPDATE [AttributeQualifier] SET [Value] = CAST( @ProjectDefinedTypeId AS varchar )
                WHERE [Guid] = 'E5635789-1F3D-4EE5-9230-80A61FC3788C'
            ");

            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "Financial Edge Export", "fa fa-calculator", "", "7EBDA9FC-667D-4A5A-88D9-894CEE5F0DF6");   // batch
            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "Financial Edge Export", "fa fa-calculator", "", "13EFF4FB-7FEE-4071-9DA8-FE911A1C8456");   // transaction detail
            RockMigrationHelper.UpdateCategory("5997C8D3-8840-4591-99A5-552919F90CBD", "Financial Edge Export", "fa fa-calculator", "", "FC9B74D6-ABB7-4D01-836C-C811859F0F62");   // account

            Sql(@"
                --
                -- Set FinancialBatch Date Exported attribute to category
                --
                DECLARE @BatchEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = 'BDD09C8E-2C52-4D08-9062-BE7D52D190C2' )
                DECLARE @BatchCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = '7EBDA9FC-667D-4A5A-88D9-894CEE5F0DF6' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @BatchEntityTypeId
                WHERE [Id] = @BatchCategoryId

				DECLARE @BatchDateExportedId int = ( SELECT [Id] FROM [Attribute] WHERE [Guid] = '16EFE0B4-E607-4960-BC92-8D66854E827A' )

				IF NOT EXISTS ( SELECT [AttributeId], [CategoryId] FROM [AttributeCategory] WHERE [AttributeId] = @BatchDateExportedId AND [CategoryId] = @BatchCategoryId )

                BEGIN
                    INSERT INTO [AttributeCategory]
                    SELECT [Id], @BatchCategoryId
                    FROM [Attribute]
                    WHERE [Guid] = '16EFE0B4-E607-4960-BC92-8D66854E827A'
                END

                --
                -- Set FinancialTransactionDetail Project attribute to category
                --
                DECLARE @TransactionDetailEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = 'AC4AC28B-8E7E-4D7E-85DB-DFFB4F3ADCCE' )
                DECLARE @TransactionDetailCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = '13EFF4FB-7FEE-4071-9DA8-FE911A1C8456' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @TransactionDetailEntityTypeId
                WHERE [Id] = @TransactionDetailCategoryId

				DECLARE @TransactionDetailProjectId int = ( SELECT [Id] FROM [Attribute] WHERE [Guid] = '0450CE22-2C04-453F-B688-5FC687FA59B0' )

				IF NOT EXISTS ( SELECT [AttributeId], [CategoryId] FROM [AttributeCategory] WHERE [AttributeId] = @TransactionDetailProjectId AND [CategoryId] = @TransactionDetailCategoryId )

                BEGIN
                    INSERT INTO [AttributeCategory]
                    SELECT [Id], @TransactionDetailCategoryId
                    FROM [Attribute]
                    WHERE [Guid] = '0450CE22-2C04-453F-B688-5FC687FA59B0'
                END

                --
                -- Set FinancialAccount attributes to category
                --
                DECLARE @AccountEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = '798BCE48-6AA7-4983-9214-F9BCEFB4521D' )
                DECLARE @AccountCategoryId int = ( SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = 'FC9B74D6-ABB7-4D01-836C-C811859F0F62' )

                UPDATE [Category]
                SET [EntityTypeQualifierColumn] = 'EntityTypeId',  [EntityTypeQualifierValue] = @AccountEntityTypeId
                WHERE [Id] = @AccountCategoryId

				DECLARE @AccountDefaultProject int = ( SELECT [Id] FROM [Attribute] WHERE [Guid] = '8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC' )

				IF NOT EXISTS ( SELECT [AttributeId], [CategoryId] FROM [AttributeCategory] WHERE [AttributeId] = @AccountDefaultProject AND [CategoryId] = @AccountCategoryId )

                BEGIN
                    INSERT INTO [AttributeCategory]
                    SELECT [Id], @AccountCategoryId
                    FROM [Attribute]
                    WHERE [Guid] = '8F47F40F-01EF-44F6-BA4E-E1E75E9E4DAC'
                END

				DECLARE @AccountCredit int = ( SELECT [Id] FROM [Attribute] WHERE [Guid] = '82688734-FEAF-48B2-9948-80EA225EC938' )

				IF NOT EXISTS ( SELECT [AttributeId], [CategoryId] FROM [AttributeCategory] WHERE [AttributeId] = @AccountCredit AND [CategoryId] = @AccountCategoryId )

                BEGIN
                    INSERT INTO [AttributeCategory]
                    SELECT [Id], @AccountCategoryId
                    FROM [Attribute]
                    WHERE [Guid] = '82688734-FEAF-48B2-9948-80EA225EC938'
                END

				DECLARE @AccountDebit int = ( SELECT [Id] FROM [Attribute] WHERE [Guid] = '0726BE0F-0B41-4FB5-A3CC-352B2B46A2CD' )

				IF NOT EXISTS ( SELECT [AttributeId], [CategoryId] FROM [AttributeCategory] WHERE [AttributeId] = @AccountDebit AND [CategoryId] = @AccountCategoryId )

                BEGIN
                    INSERT INTO [AttributeCategory]
                    SELECT [Id], @AccountCategoryId
                    FROM [Attribute]
                    WHERE [Guid] = '0726BE0F-0B41-4FB5-A3CC-352B2B46A2CD'
                END
            ");

            // create page for project defined type
            RockMigrationHelper.AddPage(true, Rock.SystemGuid.Page.ADMINISTRATION_FINANCE, "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Financial Edge Projects", "", "D42C767A-A388-4565-AA08-77FAFF01CE5B", "fa fa-clipboard", "2B630A3B-E081-4204-A3E4-17BB3A5F063D");

            // add defined type detail to Financial Edge project page
            RockMigrationHelper.AddBlock(true, "D42C767A-A388-4565-AA08-77FAFF01CE5B", "", "08C35F15-9AF7-468F-9D50-CDFD3D21220C", "Defined Type Detail", "Main", "", "", 0, "B2A6E042-A8B6-4911-A5E5-6860C3DED96A");
            RockMigrationHelper.AddBlockAttributeValue(true, "B2A6E042-A8B6-4911-A5E5-6860C3DED96A", "0305EF98-C791-4626-9996-F189B9BB674C", @"35178732-932A-472F-8D39-526B8E45625E");

            // add defined value list block and set to projects defined type
            RockMigrationHelper.AddBlock(true, "D42C767A-A388-4565-AA08-77FAFF01CE5B", "", "0AB2D5E9-9272-47D5-90E4-4AA838D2D3EE", "Financial Edge Projects", "Main", "", "", 1, "5F882086-AE21-4736-B908-BB2BF58ECA60");
            RockMigrationHelper.AddBlockAttributeValue(true, "5F882086-AE21-4736-B908-BB2BF58ECA60", "9280D61F-C4F3-4A3E-A9BB-BCD67FF78637", "35178732-932A-472F-8D39-526B8E45625E");

            // block type
            RockMigrationHelper.RenameBlockType("~/Plugins/com_kfs/FinancialEdge/BatchToJournal.ascx", "~/Plugins/rocks_kfs/FinancialEdge/BatchToJournal.ascx");
            RockMigrationHelper.UpdateBlockType("Financial Edge Batch to Journal", "Block used to create Journal Entries in Financial Edge from a Rock Financial Batch.", "~/Plugins/rocks_kfs/FinancialEdge/BatchToJournal.ascx", "KFS > Financial Edge", "CC716B06-4674-4CBE-9C66-E7DCB42153CB");

            // block on the Financial Batch Details page
            RockMigrationHelper.AddBlock(true, Rock.SystemGuid.Page.FINANCIAL_BATCH_DETAIL, "", "CC716B06-4674-4CBE-9C66-E7DCB42153CB", "Financial Edge Batch To Journal", "Main", "", "", 0, "EAB705EF-22AF-4A6E-9531-A094AB913DC3");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddDefinedType("Workflow", "Workflow Note Type", "The type of notes that can be associated with a workflow.", "FDC7A191-717E-4CA6-9DCF-A2B5BB09C782");
            RockMigrationHelper.AddDefinedTypeAttribute("FDC7A191-717E-4CA6-9DCF-A2B5BB09C782", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Icon Class Name", "IconClass", "The class name to use when rendering an icon for notes of this type", 0, "", "629CFBFF-3A95-4294-B13C-37F4FED04FE7");

            RockMigrationHelper.AddDefinedValue("FDC7A191-717E-4CA6-9DCF-A2B5BB09C782", "User Note", "User entered note", "534489FB-E239-4C51-8F5D-9ECF85E9CDE2");
            RockMigrationHelper.AddDefinedValueAttributeValue("534489FB-E239-4C51-8F5D-9ECF85E9CDE2", "629CFBFF-3A95-4294-B13C-37F4FED04FE7", "fa fa-comment");

            RockMigrationHelper.AddDefinedValue("FDC7A191-717E-4CA6-9DCF-A2B5BB09C782", "System Note", "System entered note", "414E9F98-4709-4895-AEBA-E41773BB7EB8");
            RockMigrationHelper.AddDefinedValueAttributeValue("414E9F98-4709-4895-AEBA-E41773BB7EB8", "629CFBFF-3A95-4294-B13C-37F4FED04FE7", "fa fa-file-text");

            Sql(@"
    DECLARE @DefinedTypeId int = ( SELECT TOP 1 [Id] FROM [DefinedType] WHERE [Guid] = 'FDC7A191-717E-4CA6-9DCF-A2B5BB09C782' )
    DECLARE @WorkflowEntityTypeId int = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Guid] = '3540E9A7-FE30-43A9-8B0A-A372B63DFC93' )
    IF @DefinedTypeId IS NOT NULL AND @WorkflowEntityTypeId IS NOT NULL 
    BEGIN
	    IF EXISTS ( SELECT [Id] FROM [NoteType] WHERE [EntityTypeId] = @WorkflowEntityTypeId AND ( [Name] = 'WorkflowNote' OR [Name] = 'Workflow Note' ) )
	    BEGIN
		    UPDATE [NoteType] SET 
                [IsSystem] = 1,
                [Name] = 'Workflow Note',
			    [SourcesTypeId] = @DefinedTypeId,
			    [Guid] = 'A6CE445C-3B49-4401-82E6-312BF7946A6B'
		    WHERE [EntityTypeId] = @WorkflowEntityTypeId 
		    AND ( [Name] = 'WorkflowNote' OR [Name] = 'Workflow Note' )
	    END
	    ELSE
	    BEGIN
		    INSERT INTO [NoteType] ( [IsSystem], [EntityTypeId], [Name], [SourcesTypeId], [EntityTypeQualifierColumn], [EntityTypeQualifierValue], [Guid] )
		    VALUES ( 1, @WorkflowEntityTypeId, 'Workflow Note', @DefinedTypeId, '', '', 'A6CE445C-3B49-4401-82E6-312BF7946A6B')
	    END
    END
");

            Sql(@"
    UPDATE Q 
	    SET [Value] = 'General^General Inquiry,
Login^Login / Username / Password Assistance,
Website^Feedback about the web site,
Finance^Contributions / Finance,
Missions^Missions / Global Trips,
Pastor^Talk to a Pastor'
    FROM [Attribute] A
    INNER JOIN [AttributeQualifier] Q 
	    ON Q.[AttributeId] = A.[Id]
	    AND Q.[Key] = 'values'
    WHERE A.[Guid] = 'DA61CA95-0106-49EE-962B-F70042E1464E'
    AND Q.[Value] = 'General:General Inquiry,
Login:Login / Username / Password Assistance,
Website:Feedback about the web site,
Finance:Contributions / Finance,
Missions:Missions / Global Trips,
Pastor:Talk to a Pastor'
");

            // Add Block to Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlock("BA547EED-5537-49CF-BD4E-C583D760788C", "", "2E9F32D4-B4FC-4A5F-9BE1-B2E3EA624DD3", "Notes", "Main", "", "", 1, "3A289F81-3048-419B-8A78-2B15967CC42B");
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "3CB0A7DF-996B-4D6C-B3B6-9BBCC40BDC69", @"Notes");
            // Attrib Value for Block:Notes, Attribute:Heading Icon CSS Class Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "B69937BE-000A-4B94-852F-16DE92344392", @"fa fa-comment");
            // Attrib Value for Block:Notes, Attribute:Note Term Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "FD0727DC-92F4-4765-82CB-3A08B7D864F8", @"Note");
            // Attrib Value for Block:Notes, Attribute:Display Type Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "5232BFAE-4DC8-4270-B38F-D29E1B00AB5E", @"Full");
            // Attrib Value for Block:Notes, Attribute:Use Person Icon Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "C05757C0-E83E-4170-8CBF-C4E1ABEC36E1", @"False");
            // Attrib Value for Block:Notes, Attribute:Allow Anonymous Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "EB9CBD02-2B0F-4BA3-9112-BC73D54159E7", @"False");
            // Attrib Value for Block:Notes, Attribute:Add Always Visible Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "8E0BDD15-6B92-4BB0-9138-E9382B60F3A9", @"False");
            // Attrib Value for Block:Notes, Attribute:Display Order Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "C9FC2C09-1BF5-4711-8F97-0B96633C46B1", @"Descending");
            // Attrib Value for Block:Notes, Attribute:Entity Type Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "F1BCF615-FBCA-4BC2-A912-C35C0DC04174", @"3540e9a7-fe30-43a9-8b0a-a372b63dfc93");
            // Attrib Value for Block:Notes, Attribute:Note Type Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "4EC3F5BD-4CD9-4A47-A49B-915ED98203D6", @"Workflow Note");
            // Attrib Value for Block:Notes, Attribute:Show Private Checkbox Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "D68EE1F5-D29F-404B-945D-AD0BE76594C3", @"False");
            // Attrib Value for Block:Notes, Attribute:Show Security Button Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "00B6EBFF-786D-453E-8746-119D0B45CB3E", @"False");
            // Attrib Value for Block:Notes, Attribute:Show Alert Checkbox Page: Workflow Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("3A289F81-3048-419B-8A78-2B15967CC42B", "20243A98-4802-48E2-AF61-83956056AC65", @"True");

            // Add/Update PageContext for Page:Workflow Detail, Entity: Rock.Model.Workflow, Parameter: workflowid
            RockMigrationHelper.UpdatePageContext("BA547EED-5537-49CF-BD4E-C583D760788C", "Rock.Model.Workflow", "workflowid", "55B1F94F-6498-4616-A1EC-4891E3FF2299");


            // Migration Rollups

            Sql(@"
      UPDATE [HtmlContent]
    SET [Content] = '<ul class=""list-group list-group-panel"">
<li class=""list-group-item""><a href=""http://www.rockrms.com/"">Rock RMS Website</a></li>
<li class=""list-group-item""><a href=""~/page/1"">External Website</a></li>
</ul>'
    WHERE [Guid] = '007EA905-D5D3-4DC5-AD0B-2C1E3935E452' AND [ModifiedDateTime] IS NULL
");

            Sql(@"
UPDATE [SystemEmail]
SET [Body] = '{{ GlobalAttribute.EmailHeader }}

<p>{{ Person.FirstName }},</p>
<p>The following {{ Workflow.WorkflowType.Name }} requires action:<p>
<p>{{ Workflow.WorkflowType.WorkTerm}}: <a href=''{{ GlobalAttribute.InternalApplicationRoot }}WorkflowEntry/{{ Workflow.WorkflowTypeId }}?WorkflowGuid={{ Workflow.Guid }}''>{{ Workflow.Name }}</a></p>

{% assign RequiredFields = false %}

<h3 class=""separator"">Details</h3>



{% for attribute in Action.FormAttributes %}

    
    {% if attribute.IsVisible and attribute.Value != '''' %}
        <div>
            <strong>{{ attribute.Name }}:</strong>
            <br />
            
                {% if attribute.Url and attribute.Url != '''' %}
                    <a href=''{{ attribute.Url }}''>{{ attribute.Value }}</a>
                {% else %}
                    {{ attribute.Value }}
                {% endif %}

        </div>
        <br />
    {% endif %}
    
        
    {% if attribute.IsRequired && attribute.Value == Empty %}
        {% assign RequiredFields = true %}
    {% endif %}

{% endfor %}



<table width=""100%"">
    <tr>
        <td>

    <table align=""left"" style=""width: 29%; min-width: 190px; margin-bottom: 12px;"" cellpadding=""0"" cellspacing=""0"">
     <tr>
       <td>
    
            <div><!--[if mso]>
              <v:roundrect xmlns:v=""urn:schemas-microsoft-com:vml"" xmlns:w=""urn:schemas-microsoft-com:office:word"" href=""{{ GlobalAttribute.InternalApplicationRoot }}WorkflowEntry/{{ Workflow.WorkflowTypeId }}?WorkflowGuid={{ Workflow.Guid }}"" style=""height:38px;v-text-anchor:middle;width:175px;"" arcsize=""11%"" strokecolor=""#269abc"" fillcolor=""#31b0d5"">
                <w:anchorlock/>
                <center style=""color:#ffffff;font-family:sans-serif;font-size:14px;font-weight:normal;"">View Details</center>
              </v:roundrect>
            <![endif]--><a href=""{{ GlobalAttribute.InternalApplicationRoot }}WorkflowEntry/{{ Workflow.WorkflowTypeId }}?WorkflowGuid={{ Workflow.Guid }}""
            style=""background-color:#31b0d5;border:1px solid #269abc;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:14px;font-weight:normal;line-height:38px;text-align:center;text-decoration:none;width:175px;-webkit-text-size-adjust:none;mso-hide:all;"">View Details</a></div>
    
        </td>
     </tr>
    </table>

    {% if Action.ActionType.WorkflowForm.IncludeActionsInNotification == true %}

        {% if RequiredFields != true %}
    
            {% for button in Action.ActionType.WorkflowForm.Buttons %}
                {% capture ButtonLinkSearch %}{% raw %}{{ ButtonLink }}{% endraw %}{% endcapture %}
                {% capture ButtonLinkReplace %}{{ GlobalAttribute.InternalApplicationRoot }}WorkflowEntry/{{ Workflow.WorkflowTypeId }}?WorkflowGuid={{ Workflow.Guid }}&action={{ button.Name }}{% endcapture %}
                {% capture ButtonHtml %}{{ button.EmailHtml | Replace: ButtonLinkSearch, ButtonLinkReplace }}{% endcapture %}

                {% capture ButtonTextSearch %}{% raw %}{{ ButtonText }}{% endraw %}{% endcapture %}
                {% capture ButtonTextReplace %}{{ button.Name }}{% endcapture %}
                {{ ButtonHtml | Replace: ButtonTextSearch, ButtonTextReplace }}
            {% endfor %}
        {% endif %}

    {% endif %}

        </td>
    </tr>
</table>


{{ GlobalAttribute.EmailFooter }}'
WHERE [Guid] = '88C7D1CC-3478-4562-A301-AE7D4D7FFF6D'
");

            Sql(@"
/*
<doc>
	<summary>
        This function returns the address of the person provided.
	</summary>

	<returns>
		Address of the person.
	</returns>
	<remarks>
		This function allows you to request an address for a specific person. It will return
		the first address of that type (multiple address are possible if the individual is in
		multiple families). 
		
		You can provide the address type by specifing 'Home', 'Previous', 
		'Work'. For custom address types provide the AddressTypeId like '19'.

		You can also determine which component of the address you'd like. Values include:
			+ 'Full' - the full address 
			+ 'Street1'
			+ 'Street2'
			+ 'City'
			+ 'State'
			+ 'PostalCode'
			+ 'Country'

	</remarks>
	<code>
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'Full')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'Street1')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'Street2')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'City')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'State')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'PostalCode')
		SELECT [dbo].[ufnCrm_GetAddress](3, 'Home', 'Country')
	</code>
</doc>
*/

CREATE FUNCTION [dbo].[ufnCrm_GetAddress](
	@PersonId int, 
	@AddressType varchar(20),
	@AddressComponent varchar(20)) 

RETURNS nvarchar(250) AS

BEGIN
	DECLARE @AddressTypeId int

	-- get address type
	IF (@AddressType = 'Home')
		BEGIN
		SET @AddressTypeId = 19
		END
	ELSE IF (@AddressType = 'Work')
		BEGIN
		SET @AddressTypeId = 20
		END
	ELSE IF (@AddressType = 'Previous')
		BEGIN
		SET @AddressTypeId = 137
		END
	ELSE
		SET @AddressTypeId = CAST(@AddressType AS int)

	-- return address component
	IF (@AddressComponent = 'Street1')
		BEGIN
		RETURN (SELECT [Street1] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE IF (@AddressComponent = 'Street2')
		BEGIN
		RETURN (SELECT [Street2] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE IF (@AddressComponent = 'City')
		BEGIN
		RETURN (SELECT [City] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE IF (@AddressComponent = 'State')
		BEGIN
		RETURN (SELECT [State] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE IF (@AddressComponent = 'PostalCode')
		BEGIN
		RETURN (SELECT [PostalCode] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE IF (@AddressComponent = 'Country')
		BEGIN
		RETURN (SELECT [Country] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END
	ELSE 
		BEGIN
		RETURN (SELECT [Street1] + ' ' + [Street2] + ' ' + [City] + ', ' + [State] + ' ' + [PostalCode] FROM [Location] WHERE [Id] = (SELECT [LocationId] FROM [GroupLocation] WHERE  [GroupLocationTypeValueId] = @AddressTypeId AND  [GroupId] = (SELECT TOP 1 [GroupId] FROM [GroupMember] gm INNER JOIN [Group] g ON g.[Id] = gm.[GroupId] WHERE [PersonId] = @PersonId AND g.[GroupTypeId] = 10))) 
		END

	RETURN ''
END
");

            Sql(@"
    UPDATE [BinaryFileData]
    SET Content = 0x0A3C212D2D2073617665642066726F6D2075726C3D283030373629687474703A2F2F6C6F63616C686F73743A363232392F47657446696C652E617368783F677569643D66393865396236312D336662342D343366342D386333302D346565636432663534393637202D2D3E0A3C68746D6C3E3C686561643E3C6D65746120687474702D65717569763D22436F6E74656E742D547970652220636F6E74656E743D22746578742F68746D6C3B20636861727365743D5554462D38223E3C2F686561643E3C626F64793E3C707265207374796C653D22776F72642D777261703A20627265616B2D776F72643B2077686974652D73706163653A207072652D777261703B223E1043547E7E43442C7E43435E7E43547E0A5E58417E54413030307E4A534E5E4C54305E4D4E575E4D54445E504F4E5E504D4E5E4C48302C305E4A4D415E5052362C367E534431355E4A55535E4C524E5E4349305E585A0A5E58410A5E4D4D540A5E50573831320A5E4C4C303430360A5E4C53300A5E46543434332C3131395E41304E2C3133352C3133345E46423333332C312C302C525E46485C5E46445757575E46530A5E465431322C3236385E41304E2C3133352C3134365E46485C5E4644355E46530A5E465431342C3332375E41304E2C34352C34355E46485C5E4644365E46530A5E464F3632362C3334305E474236302C35362C35365E46530A5E46543632362C3338345E41304E2C34352C34355E464237302C312C302C435E46525E46485C5E46444141415E46530A5E464F3731392C3334305E474236302C35362C35365E46530A5E46543731392C3338345E41304E2C34352C34355E464237302C312C302C435E46525E46485C5E46444C4C4C5E46530A5E46543333362C3130335E41304E2C3130322C3130305E46485C5E4644325E46530A5E46543430312C3130335E41304E2C3130322C3130305E46485C5E4644335E46530A5E46543334322C3133305E41304E2C32382C32385E46485C5E4644345E46530A5E46543333382C3338355E41304E2C32382C32385E46485C5E464431305E46530A5E465431332C3338355E41304E2C32382C32385E46485C5E4644395E46530A5E4C52595E464F302C305E47423831322C302C3133365E46535E4C524E0A5E5051312C302C312C595E585A0A3C2F7072653E3C2F626F64793E3C2F68746D6C3E
    WHERE [Guid] = 'DF44734E-473B-4009-9099-7BA25C8EA36A'
");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, string.Empty, string.Empty, "Grade Label", "The label for items that refer to the grade that the person is in.", 0, "Grade", "20A402B4-4098-4040-948E-0C20E44780DD", "core.GradeLabel");

            RockMigrationHelper.AddDefinedType("Global", "School Grades", "Used to calculate school classes/grades in a way that can be modified for internationalization.", "24E5A79F-1E62-467A-AD5D-0D10A2328B4D", @"");

            RockMigrationHelper.AddDefinedTypeAttribute("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Abbreviation", "Abbreviation", "", 31, "", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0");
            RockMigrationHelper.AddAttributeQualifier("839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", "ispassword", "False", "33ECF11F-F69C-4A20-B5A3-25C563C859E6");

            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "0", "Senior", "C49BD3AF-FF94-4A7C-99E1-08503A3C746E", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "1", "Junior", "78F7D773-8244-4995-8BC4-AD6F6A7B7820", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "2", "Sophomore", "E04E3F62-EF5C-4860-8F32-1C152CA1700A", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "3", "Freshman", "2A130E04-3712-427A-8BB0-473EB8FF8924", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "4", "8th Grade", "D58D70AF-3CCC-4D4E-BFAF-2014D8579D60", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "5", "7th Grade", "3FE728AC-BE25-409A-98CB-3CFCE5FA063B", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "6", "6th Grade", "2D702ED8-7046-4DA5-AFFA-9633A211F594", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "7", "5th Grade", "3D8CDBC8-8840-4A7E-85D0-B7C29A019EBB", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "8", "4th Grade", "F0F98B9C-E6BE-4C42-B8F4-0D8AB1A18847", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "9", "3rd Grade", "23CC6288-78ED-4849-AFC9-417E0DA5A4A9", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "10", "2nd Grade", "E475D0CA-5979-4C76-8788-D91ADF595E10", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "11", "1st Grade", "6B5CDFBD-9882-4EBB-A01A-7856BCD0CF61", false);
            RockMigrationHelper.AddDefinedValue("24E5A79F-1E62-467A-AD5D-0D10A2328B4D", "12", "Kindergarten", "0FED3291-51F3-4EED-886D-1D3DF826BEAC", false);

            RockMigrationHelper.AddDefinedValueAttributeValue("0FED3291-51F3-4EED-886D-1D3DF826BEAC", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"K");
            RockMigrationHelper.AddDefinedValueAttributeValue("6B5CDFBD-9882-4EBB-A01A-7856BCD0CF61", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"1st");
            RockMigrationHelper.AddDefinedValueAttributeValue("E475D0CA-5979-4C76-8788-D91ADF595E10", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"2nd");
            RockMigrationHelper.AddDefinedValueAttributeValue("23CC6288-78ED-4849-AFC9-417E0DA5A4A9", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"3rd");
            RockMigrationHelper.AddDefinedValueAttributeValue("F0F98B9C-E6BE-4C42-B8F4-0D8AB1A18847", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"4th");
            RockMigrationHelper.AddDefinedValueAttributeValue("3D8CDBC8-8840-4A7E-85D0-B7C29A019EBB", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"5th");
            RockMigrationHelper.AddDefinedValueAttributeValue("2D702ED8-7046-4DA5-AFFA-9633A211F594", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"6th");
            RockMigrationHelper.AddDefinedValueAttributeValue("3FE728AC-BE25-409A-98CB-3CFCE5FA063B", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"7th");
            RockMigrationHelper.AddDefinedValueAttributeValue("D58D70AF-3CCC-4D4E-BFAF-2014D8579D60", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"8th");
            RockMigrationHelper.AddDefinedValueAttributeValue("2A130E04-3712-427A-8BB0-473EB8FF8924", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"9th");
            RockMigrationHelper.AddDefinedValueAttributeValue("E04E3F62-EF5C-4860-8F32-1C152CA1700A", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"10th");
            RockMigrationHelper.AddDefinedValueAttributeValue("78F7D773-8244-4995-8BC4-AD6F6A7B7820", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"11th");
            RockMigrationHelper.AddDefinedValueAttributeValue("C49BD3AF-FF94-4A7C-99E1-08503A3C746E", "839B67E3-6A12-46D9-8F7F-5DFCB4F8DBE0", @"12th");


            // Migration Rollups

            Sql(@"
/*
<doc>
	<summary>
		This stored procedure returns the Mailing Addresses and any CustomMessages for the Contribution Statement, but not the actual transactions
		The StatementGenerator utility uses this procedure along with querying transactions thru REST to generate statements
	</summary>

	<returns>
		* PersonId
		* GroupId
		* AddressPersonNames
		* Street1
		* Street2
		* City
		* State
		* PostalCode
		* StartDate
		* EndDate
		* CustomMessage1
		* CustomMessage2
	</returns>
	<param name='StartDate' datatype='datetime'>The starting date of the date range</param>
	<param name='EndDate' datatype='datetime'>The ending date of the date range</param>
	<param name='AccountIds' datatype='varchar(max)'>Comma delimited list of account ids. NULL means all</param>
	<param name='PersonId' datatype='int'>Person the statement if for. NULL means all persons that have transactions for the date range</param>
	<param name='OrderByPostalCode' datatype='int'>Set to 1 to have the results sorted by PostalCode, 0 for no particular order</param>
	<remarks>	
		Uses the following constants:
			* Group Type - Family: 790E3215-3B10-442B-AF69-616C0DCB998E
			* Group Role - Adult: 2639F9A5-2AAE-4E48-A8C3-4FFE86681E42
			* Group Role - Child: C8B1814F-6AA7-4055-B2D7-48FE20429CB9
	</remarks>
	<code>
		EXEC [dbo].[spFinance_ContributionStatementQuery] '01-01-2014', '01-01-2015', null, null, 0, 1 -- year 2014 statements for all persons that have a mailing address
        EXEC [dbo].[spFinance_ContributionStatementQuery] '01-01-2014', '01-01-2015', null, null, 1, 1 -- year 2014 statements for all persons regardless of mailing address
        EXEC [dbo].[spFinance_ContributionStatementQuery] '01-01-2014', '01-01-2015', null, 2, 1, 1  -- year 2014 statements for Ted Decker
	</code>
</doc>
*/
ALTER PROCEDURE [dbo].[spFinance_ContributionStatementQuery]
	@StartDate datetime
	, @EndDate datetime
	, @AccountIds varchar(max) 
	, @PersonId int -- NULL means all persons
    , @IncludeIndividualsWithNoAddress bit 
	, @OrderByPostalCode bit
AS
BEGIN
	DECLARE @cGROUPTYPE_FAMILY uniqueidentifier = '790E3215-3B10-442B-AF69-616C0DCB998E'	
	DECLARE @cLOCATION_TYPE_HOME uniqueidentifier = '8C52E53C-2A66-435A-AE6E-5EE307D9A0DC'

	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	;WITH tranListCTE
	AS
	(
		SELECT  
			[pa].[PersonId] 
		FROM 
			[FinancialTransaction] [ft]
		INNER JOIN 
			[FinancialTransactionDetail] [ftd] ON [ft].[Id] = [ftd].[TransactionId]
		INNER JOIN 
			[PersonAlias] [pa] ON [pa].[id] = [ft].[AuthorizedPersonAliasId]
		WHERE 
			([TransactionDateTime] >= @StartDate and [TransactionDateTime] < @EndDate)
		AND 
			(
				(@AccountIds is null)
				OR
				(ftd.[AccountId] in (select * from ufnUtility_CsvToTable(@AccountIds)))
			)
	)

	SELECT * FROM (
    SELECT 
		  [pg].[PersonId]
		, [pg].[GroupId]
		, [pn].[PersonNames] [AddressPersonNames]
        , case when l.Id is null then 0 else 1 end [HasAddress]
		, [l].[Street1]
		, [l].[Street2]
		, [l].[City]
		, [l].[State]
		, [l].[PostalCode]
		, @StartDate [StartDate]
		, @EndDate [EndDate]
		, null [CustomMessage1]
		, null [CustomMessage2]
	FROM (
		-- Get distinct Giving Groups for Persons that have a specific GivingGroupId and have transactions that match the filter
		-- These are Persons that give as part of a Group.  For example, Husband and Wife
		SELECT DISTINCT
			null [PersonId] 
			, [g].[Id] [GroupId]
		FROM 
			[Person] [p]
		INNER JOIN 
			[Group] [g] ON [p].[GivingGroupId] = [g].[Id]
		WHERE 
		(
			(@personId is null) 
		OR 
			([p].[Id] = @personId)
		)
        AND
			[p].[Id] in (SELECT * FROM tranListCTE)
		UNION
		-- Get Persons and their GroupId(s) that do not have GivingGroupId and have transactions that match the filter.        
		-- These are the persons that give as individuals vs as part of a group. We need the Groups (families they belong to) in order 
		-- to determine which address(es) the statements need to be mailed to 
		SELECT  
			[p].[Id] [PersonId],
			[g].[Id] [GroupId]
		FROM
			[Person] [p]
		JOIN 
			[GroupMember] [gm]
		ON 
			[gm].[PersonId] = [p].[Id]
		JOIN 
			[Group] [g]
		ON 
			[gm].[GroupId] = [g].[Id]
		WHERE
			[p].[GivingGroupId] is null
		AND
			[g].[GroupTypeId] = (SELECT Id FROM GroupType WHERE [Guid] = @cGROUPTYPE_FAMILY)
        AND
		(
			(@personId is null) 
		OR 
			([p].[Id] = @personId)
		)
		AND [p].[Id] IN (SELECT * FROM tranListCTE)
	) [pg]
	CROSS APPLY 
		[ufnCrm_GetFamilyTitle]([pg].[PersonId], [pg].[GroupId]) [pn]
	LEFT OUTER JOIN (
    SELECT l.*, gl.GroupId from
		[GroupLocation] [gl] 
	LEFT OUTER JOIN
		[Location] [l]
	ON 
		[l].[Id] = [gl].[LocationId]
	WHERE 
		[gl].[IsMailingLocation] = 1
	AND
		[gl].[GroupLocationTypeValueId] = (SELECT Id FROM DefinedValue WHERE [Guid] = @cLOCATION_TYPE_HOME)
        ) [l] 
        ON 
		[l].[GroupId] = [pg].[GroupId]
    ) n
    WHERE n.HasAddress = 1 or @IncludeIndividualsWithNoAddress = 1
    ORDER BY
	CASE WHEN @OrderByPostalCode = 1 THEN PostalCode END
    
END
");

            RockMigrationHelper.AddSecurityAuthForEntityType("Rock.Model.GroupType", 0, "View", true, "2C112948-FF4C-46E7-981A-0257681EADF4", 0, "25bb9da3-f680-0d80-45ed-e944eff95353");
            RockMigrationHelper.AddSecurityAuthForEntityType("Rock.Model.GroupType", 1, "View", true, "628C51A8-4613-43ED-A18D-4A6FB999273E", 0, "6ce1f6a9-bb91-8fb3-4316-9dcfc90fd6af");
            RockMigrationHelper.AddSecurityAuthForEntityType("Rock.Model.GroupType", 2, "View", true, "300BA2C8-49A3-44BA-A82A-82E3FD8C3745", 0, "ee3226ce-b1d5-b995-49f7-6b3f4a1f5fd7");
            RockMigrationHelper.AddSecurityAuthForEntityType("Rock.Model.GroupType", 3, "View", false, null, 1, "73a2c6c6-d13a-6493-4121-3867ec60492a");

            Sql(@"
    UPDATE [AttributeValue] 
    SET [Value] = '{% if Person.FirstTime == true %}F{% endif %}'
    WHERE [Guid] = 'F9D654E2-B715-4C6A-B875-AC690B21B3E8'
");
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // Add new block types
            RockMigrationHelper.UpdateBlockType("Following By Entity", "Takes a entity type and displays a person's following items for that entity using a Lava template.", "~/Blocks/Core/FollowingByEntityLava.ascx", "Core", "36B56055-7AA2-4169-82DD-CCFBD2C7B4CC");
            RockMigrationHelper.UpdateBlockType("Event Calendar Item Personalized Registration", "Simplifies the registration process for a given person and event calendar item.", "~/Blocks/Event/EventCalendarItemPersonalizedRegistration.ascx", "Event", "1A1FFACC-D74C-4061-B6A7-34150C462DB7");

            // Attrib for BlockType: Following By Entity:Link URL
            RockMigrationHelper.AddBlockTypeAttribute("36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Link URL", "LinkUrl", "", "The address to use for the link. The text '[Id]' will be replaced with the Id of the entity '[Guid]' will be replaced with the Guid.", 1, @"/samplepage/[Id]", "9981ABB3-7130-41DB-87AF-973722FBD54E");

            // Attrib for BlockType: Following By Entity:Enable Debug
            RockMigrationHelper.AddBlockTypeAttribute("36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enable Debug", "EnableDebug", "", "Show merge data to help you see what's available to you.", 3, @"False", "D7094B16-B237-4D97-B1FC-F680C0701583");

            // Add My Dashboard Page
            RockMigrationHelper.AddPage("20F97A93-7949-4C2A-8A5E-C756FE8585CA", "22D220B5-0D34-429A-B9E3-59D80AE423E7", "My Dashboard", "", "AE1818D8-581C-4599-97B9-509EA450376A", "fa fa-tachometer"); // Site:Rock RMS
            RockMigrationHelper.AddPageRoute("AE1818D8-581C-4599-97B9-509EA450376A", "MyDashboard");                                                                                                     // for Page:My Dashboard

            // hide page from nav
            Sql(@"  UPDATE [Page]
  SET [DisplayInNavWhen] = 2
  WHERE [Guid] = 'AE1818D8-581C-4599-97B9-509EA450376A'");

            // Add Block to Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlock("AE1818D8-581C-4599-97B9-509EA450376A", "", "36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "Following Groups", "Sidebar1", "", "", 0, "AA11F703-FF26-4DA3-8CAE-E95989013135");

            // Add Block to Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlock("AE1818D8-581C-4599-97B9-509EA450376A", "", "4F217A7F-A34E-489E-AE0E-2B7EDCF69CD1", "My  Assigned Workflows", "Main", "", "", 1, "415575C3-70AC-4A7A-8936-B98464C5557F");

            // Add Block to Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlock("AE1818D8-581C-4599-97B9-509EA450376A", "", "4F217A7F-A34E-489E-AE0E-2B7EDCF69CD1", "My Open Workflows", "Sidebar1", "", "", 1, "8111124F-8201-4F54-8A2C-CDC9D7CEA1BC");

            // Add Block to Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlock("AE1818D8-581C-4599-97B9-509EA450376A", "", "19B61D65-37E3-459F-A44F-DEF0089118A3", "Intro", "Feature", "", "", 0, "6DE44644-65FE-4321-A09D-36B329D6AE04");

            // Add/Update HtmlContent for Block: Intro
            RockMigrationHelper.UpdateHtmlContentBlock("6DE44644-65FE-4321-A09D-36B329D6AE04", @"<h1>{{ CurrentPerson.NickName | Possessive}} Homepage</h1>", "F0BCB32C-CEB0-41CC-B43A-26FC66CCBD36");


            // disable cache on html block
            RockMigrationHelper.AddBlockAttributeValue("6DE44644-65FE-4321-A09D-36B329D6AE04", "4DFDB295-6D0F-40A1-BEF9-7B70C56F66C4", "0");


            // Attrib for BlockType: Group Member List:Require Note on Alternate Placement
            RockMigrationHelper.AddBlockTypeAttribute("88B7EFA9-7419-4D05-9F88-38B936E61EDD", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Require Note on Alternate Placement", "RequireAlternatePlacementNote", "", "Flag that indicates whether a note is required to save the alternate placement.", 3, @"False", "94174D1A-1C58-4456-A931-A07A8FB19154");

            // Attrib for BlockType: Following By Entity:Max Results
            RockMigrationHelper.AddBlockTypeAttribute("36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Max Results", "MaxResults", "", "The maximum number of results to display.", 4, @"100", "D2BB9E7D-9DCC-4432-88F5-D5A3058F6DEB");

            // Attrib for BlockType: Following By Entity:Entity Type
            RockMigrationHelper.AddBlockTypeAttribute("36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "3549BAB6-FE1B-4333-AFC4-C5ACA01BB8EB", "Entity Type", "EntityType", "", "The type of entity to show following for.", 0, @"", "C896AA82-F8D7-4A94-9730-D4030DA3DBFA");

            // Attrib for BlockType: Login Status:Logged In Page List
            RockMigrationHelper.AddBlockTypeAttribute("04712F3D-9667-4901-A49D-4507573EF7AD", "73B02051-0D38-4AD9-BF81-A2D477DE4F70", "Logged In Page List", "LoggedInPageList", "", "List of pages to show in the dropdown when the user is logged in. The link field takes Lava with the CurrentPerson merge fields. Place the text 'divider' in the title field to add a divider.", 0, @"", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2");

            // Attrib for BlockType: Following By Entity:Lava Template
            RockMigrationHelper.AddBlockTypeAttribute("36B56055-7AA2-4169-82DD-CCFBD2C7B4CC", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Lava Template", "LavaTemplate", "", "Lava template to use to display content", 2, @"<div class=""panel panel-block""> 
    <div class=""panel-heading"">
       <h4 class=""panel-title"">Followed {{ EntityType | Pluralize }}</h4>
    </div>
    <div class=""panel-body"">

        <ul>
        {% for item in FollowingItems %}
            {% if LinkUrl != '' %}
                <li><a href=""{{ LinkUrl | Replace:'[Id]',item.Id }}"">{{ item.Name }}</a></li>
            {% else %}
                <li>{{ item.Name }}</li>
            {% endif %}
        {% endfor %}
        </ul>
        
    </div>
</div>", "58CA8CF4-6C86-4D27-92BE-C687E74D014F");



            // Add My Dashboard to the internal login statuses

            // Attrib Value for Block:Login Status, Attribute:Logged In Page List , Layout: PersonDetail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("19C2140D-498A-4675-B8A2-18B281736F6E", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2", @"My Dashboard^~/MyDashboard|");

            // Attrib Value for Block:Login Status, Attribute:Logged In Page List , Layout: Full Width, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("82AF461F-022D-4ADB-BB12-F220CD605459", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2", @"My Dashboard^~/MyDashboard|");

            // Attrib Value for Block:Login Status, Attribute:Logged In Page List , Layout: Left Sidebar, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("791A6AA0-D498-4795-BB5F-21609175826F", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2", @"My Dashboard^~/MyDashboard|");

            // Attrib Value for Block:Login Status, Attribute:Logged In Page List , Layout: Right Sidebar, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("2356DEDC-803F-4782-A8E9-D0D88393EC2E", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2", @"My Dashboard^~/MyDashboard|");

            // Attrib Value for Block:Login Status, Attribute:Logged In Page List , Layout: Homepage, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("5A5C6063-EA0D-4EDD-A394-4B1B772F2041", "1B0E8904-196B-433E-B1CC-937AD3CA5BF2", @"");

            // Attrib Value for Block:Following Groups, Attribute:Max Results Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("AA11F703-FF26-4DA3-8CAE-E95989013135", "D2BB9E7D-9DCC-4432-88F5-D5A3058F6DEB", @"100");

            // Attrib Value for Block:Following Groups, Attribute:Entity Type Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("AA11F703-FF26-4DA3-8CAE-E95989013135", "C896AA82-F8D7-4A94-9730-D4030DA3DBFA", @"9bbfda11-0d22-40d5-902f-60adfbc88987");

            // Attrib Value for Block:Following Groups, Attribute:Link URL Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("AA11F703-FF26-4DA3-8CAE-E95989013135", "9981ABB3-7130-41DB-87AF-973722FBD54E", @"/page/113?GroupId=[Id]");

            // Attrib Value for Block:Following Groups, Attribute:Lava Template Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("AA11F703-FF26-4DA3-8CAE-E95989013135", "58CA8CF4-6C86-4D27-92BE-C687E74D014F", @"<div class=""panel panel-block""> 
    <div class=""panel-heading"">
       <h4 class=""panel-title""><i class=""fa fa-users""></i> Followed {{ EntityType | Pluralize }}</h4>
    </div>
    <div class=""panel-body"">

        <ul class=""list-unstyled"">

        {% assign itemsSorted = FollowingItems | Sort:'GroupTypeId' %}
        {% assign currentType = '' %}

        {% for item in itemsSorted %}
            {% if currentType != item.GroupTypeId %}
                {% if currentType != '' %}
                    </ul>
                {% endif %}
                
                <strong>{{ item.GroupType.Name }}</strong>
                <ul class=""list-unstyled margin-b-md"">
                {% assign currentType = item.GroupTypeId %}
            {% endif %}
            
            <li><i class=""{{ item.GroupType.IconCssClass }} icon-fw""></i> <a href=""{{ LinkUrl | Replace:'[Id]',item.Id }}"">{{ item.Name }}</a></li>
        {% endfor %}
        
        {% if currentType != '' %}
            </ul>
        {% endif %}
        
    </div>
</div>");

            // Attrib Value for Block:Following Groups, Attribute:Enable Debug Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("AA11F703-FF26-4DA3-8CAE-E95989013135", "D7094B16-B237-4D97-B1FC-F680C0701583", @"False");

            // Attrib Value for Block:My  Assigned Workflows, Attribute:Contents Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("415575C3-70AC-4A7A-8936-B98464C5557F", "D2149BA3-7AE8-4FE8-AF7C-4EF40DBEB4B2", @"{% if Actions.size > 0 %}
    <div class='panel panel-block'> 
        <div class='panel-heading'>
            <h4 class='panel-title'>My Assigned Tasks</h4>
        </div>
        <div class='panel-body'>
            <ul class='fa-ul'>
                {% for action in Actions %}
                    <li>
                        <i class='fa-li {{ action.Activity.Workflow.WorkflowType.IconCssClass }}'></i>
                        <a href='~/{% if Role == '0' %}WorkflowEntry/{{ action.Activity.Workflow.WorkflowTypeId }}{% else %}Workflow{% endif %}/{{ action.Activity.Workflow.Id }}'>{{ action.Activity.Workflow.WorkflowType.Name }}: {{ action.Activity.Workflow.Name }}{% if role == '0' %} ({{ action.Activity.ActivityType.Name }}){% endif %}</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>
{% endif %}
");

            // Attrib Value for Block:My  Assigned Workflows, Attribute:Include Child Categories Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("415575C3-70AC-4A7A-8936-B98464C5557F", "5AD3495C-AFBF-4262-BD3D-AC16FD8CF3EC", @"True");

            // Attrib Value for Block:My  Assigned Workflows, Attribute:Categories Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("415575C3-70AC-4A7A-8936-B98464C5557F", "28DF6F17-AF47-49DF-824F-9E7C8B94AD5D", @"");

            // Attrib Value for Block:My  Assigned Workflows, Attribute:Role Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("415575C3-70AC-4A7A-8936-B98464C5557F", "C8816900-0772-4E15-8D41-D20874F560BE", @"0");

            // Attrib Value for Block:My Open Workflows, Attribute:Role Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("8111124F-8201-4F54-8A2C-CDC9D7CEA1BC", "C8816900-0772-4E15-8D41-D20874F560BE", @"1");

            // Attrib Value for Block:My Open Workflows, Attribute:Categories Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("8111124F-8201-4F54-8A2C-CDC9D7CEA1BC", "28DF6F17-AF47-49DF-824F-9E7C8B94AD5D", @"");

            // Attrib Value for Block:My Open Workflows, Attribute:Include Child Categories Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("8111124F-8201-4F54-8A2C-CDC9D7CEA1BC", "5AD3495C-AFBF-4262-BD3D-AC16FD8CF3EC", @"True");

            // Attrib Value for Block:My Open Workflows, Attribute:Contents Page: My Dashboard, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("8111124F-8201-4F54-8A2C-CDC9D7CEA1BC", "D2149BA3-7AE8-4FE8-AF7C-4EF40DBEB4B2", @"{% if Actions.size > 0 %}
    <div class='panel panel-block'> 
        <div class='panel-heading'>
            <h4 class='panel-title'>My Open Requests</h4>
        </div>
        <div class='panel-body'>
            <ul class='fa-ul'>
                {% for action in Actions %}
                    <li>
                        <i class='fa-li {{ action.Activity.Workflow.WorkflowType.IconCssClass }}'></i>
                        <a href='~/{% if Role == '0' %}WorkflowEntry/{{ action.Activity.Workflow.WorkflowTypeId }}{% else %}Workflow{% endif %}/{{ action.Activity.Workflow.Id }}'>{{ action.Activity.Workflow.WorkflowType.Name }}: {{ action.Activity.Workflow.Name }}{% if role == '0' %} ({{ action.Activity.ActivityType.Name }}){% endif %}</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>
{% endif %}
");

            RockMigrationHelper.AddDefinedType("Check-in", "Family Manager Configuration", "Configuration templates for the Family Manager application.", "251D752B-0595-C3A6-4E2A-AD0264DAFCCD", @"");
            RockMigrationHelper.AddDefinedTypeAttribute("251D752B-0595-C3A6-4E2A-AD0264DAFCCD", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Configuration Template", "ConfigurationTemplate", "JSON configuration file.", 0, "", "ACC82748-157F-BF8E-4E34-FFD3C05269B3");
            RockMigrationHelper.AddAttributeQualifier("ACC82748-157F-BF8E-4E34-FFD3C05269B3", "editorHeight", "600", "8B8E9AC2-6F82-85B5-4EBF-88F2ACFA0634");
            RockMigrationHelper.AddAttributeQualifier("ACC82748-157F-BF8E-4E34-FFD3C05269B3", "editorMode", "4", "A5D7AA2D-533C-3DB5-4A46-0879A47F9B5E");
            RockMigrationHelper.AddAttributeQualifier("ACC82748-157F-BF8E-4E34-FFD3C05269B3", "editorTheme", "0", "9BD724FA-E098-0F91-4EF4-E6117E808242");
            RockMigrationHelper.AddDefinedValue("251D752B-0595-C3A6-4E2A-AD0264DAFCCD", "Rock Default", "The default theme for the Family Manager application.", "8BB6A099-1592-4E7F-AE8E-7FDEE63E040C", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("8BB6A099-1592-4E7F-AE8E-7FDEE63E040C", "ACC82748-157F-BF8E-4E34-FFD3C05269B3", @"{
	""familyAttributes"": [
	],
	""personAttributes"": [
		{""attributeId"": 2073, ""required"": true },
		{""attributeId"": 174, ""required"": false },
		{""attributeId"": 714, ""required"": true },
		{""attributeId"": 1117, ""required"": false },
		{""attributeId"": 1032, ""required"": true },
		{""attributeId"": 1059, ""required"": false }
	],
	
	""requireFamilyAddress"": false,
	""requireChildBirthdate"": true,
	""requireAdultBirthdate"": false,
	""requireChildGrade"": true,
	""firstVisitPrompt"": false,
	
	""visualSettings"": 
	{
	    ""BackgroundColor"" : ""#dcd5cbff"",
		""LogoURL"" : ""~/Assets/FamilyManagerThemes/RockDefault/rock-logo.png"",
		""AdultMaleNoPhoto"" : ""~/Assets/FamilymanagerThemes/RockDefault/photo-adult-male.png"",
		""AdultFemaleNoPhoto"" : ""~/Assets/FamilyManagerThemes/RockDefault/photo-adult-female.png"",
		""ChildMaleNoPhoto"" : ""~/Assets/FamilyManagerThemes/RockDefault/photo-child-male.png"",
		""ChildFemaleNoPhoto"" : ""~/Assets/FamilyManagerThemes/RockDefault/photo-child-female.png"",
		
		""TopHeaderBGColor"" : ""#282526FF"",
		""TopHeaderTextColor"" : ""#d3cec5FF"",
		
		""FooterBGColor"" : ""#c2b8a7FF"",
		""FooterTextColor"" : ""#847f77FF"",
	
		""SelectedPersonColor"" : ""#ee7624FF"",
		
		""LargeFontSize"" : ""18"",
		""MediumFontSize"" : ""20"",
		""SmallFontSize"" : ""14"",
				
		""DefaultButtonStyle"" :
		{
			""BackgroundColor"" : ""#d6d6d6FF"",
			""TextColor"" : ""#524c43FF"",
			""BorderColor"" : ""#c2b8a7FF"",
			""BorderWidth"" : ""1"",
			""CornerRadius"" : ""4""
		 },
		 ""PrimaryButtonStyle"" : 
		 {
		    ""BackgroundColor"" : ""#ee7624FF"",
			""TextColor"" : ""#FFFFFFFF"",
			""BorderColor"" : ""#ae4f0dff"",
			""BorderWidth"" : ""1"",
			""CornerRadius"" : ""4""
		 },
		 ""FamilyCellStyle"":
		 {
		    ""BackgroundColor"" : ""#00000000"",
			""AddFamilyButtonBGColor"" : ""#c2b8a7FF"",
			""AddFamilyButtonTextColor"" : ""#554e51FF"",
			""EntryBGColor"" : ""#c2b8a7FF"",
			""EntryTextColor"" : ""#554e51FF"",
		 },
		 ""ToggleStyle"" :
		 {
		    ""ActiveColor"" : ""#ee7624FF"",
			 ""InActiveColor"" : ""#777777FF"",
			 ""TextColor"" : ""#FFFFFFFF"",
			 ""CornerRadius"" : ""4""
		 },
		 ""DatePickerStyle"" :
		 {
			""BackgroundColor"" : ""#c2b8a7FF"",
			""TextColor"" : ""#3b3b3bFF"",
			""Size"" : ""22"",
			""Font"" : ""OpenSans-Regular""
		 },
		 ""LabelStyle"" :
		 {
		    ""TextColor"" : ""#6a6a6aFF"",
		 },
		 ""SwitchStyle"" :
		 {
		    ""OnColor"" : ""#FFFFFFFF""
		 },
		 ""TextFieldStyle"" :
		 {
		    ""TextColor"" : ""#555555FF"",
			""PlaceHolderColor"" : ""#AAAAAAFF"",
			""BorderColor"" : ""#ccccccFF"",
			""BorderWidth"" : ""1"",
			""CornerRadius"" : ""4"",
		 },
		 ""SearchResultStyle"":
		 {
		    ""BackgroundColor"" : ""#c2b8a7FF"",
			""TextColor"" : ""#3b3b3bFF""
		 }
	}
}");
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.UpdateBlockType("Link List Lava", "Displays a list of links.", "~/Blocks/Cms/LinkListLava.ascx", "CMS", "BBA9210E-80E1-486A-822D-F8842FE09F99");
            // Attrib for BlockType: Link List Lava:Enable Debug
            RockMigrationHelper.AddBlockTypeAttribute("BBA9210E-80E1-486A-822D-F8842FE09F99", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enable Debug", "EnableDebug", "", "Show merge data to help you see what's available to you.", 2, @"False", "0368A01D-975B-4FCA-BB70-7FB699BE5704");
            // Attrib for BlockType: Link List Lava:Defined Type
            RockMigrationHelper.AddBlockTypeAttribute("BBA9210E-80E1-486A-822D-F8842FE09F99", "BC48720C-3610-4BCF-AE66-D255A17F1CDF", "Defined Type", "DefinedType", "", "The defined type to use when saving link information.", 0, @"7E7969BD-945C-4472-8A80-889EF5833776", "53189258-9E59-4236-8B31-F375C9BB3E18");
            // Attrib for BlockType: Search:Search Type
            RockMigrationHelper.AddBlockTypeAttribute("E3A99534-6FD9-49AD-AC52-32D53B2CEDD7", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "Search Type", "SearchType", "", "The type of search to use for check-in (default is phone number).", 4, @"F3F66040-C50F-4D13-9652-780305FFFE23", "E5BD71C5-1D30-40F4-8E62-D3A4E68A7F86");
            // Attrib for BlockType: Link List Lava:Edit Footer
            RockMigrationHelper.AddBlockTypeAttribute("BBA9210E-80E1-486A-822D-F8842FE09F99", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Edit Footer", "EditFooter", "", "The HTML to display above list when editing values.", 4, @"
    </div>
</div>
", "EFDFAD19-43A9-4D01-80EC-41CAA6235E9D");
            // Attrib for BlockType: Link List Lava:Edit Header
            RockMigrationHelper.AddBlockTypeAttribute("BBA9210E-80E1-486A-822D-F8842FE09F99", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Edit Header", "EditHeader", "", "The HTML to display above list when editing values.", 3, @"
<div class='panel panel-block'>
    <div class='panel-heading'>
        <h4 class='panel-title'>Links</div>
    <div>
    <div class='panel-body'>
", "569B27B8-9EEB-40C7-96C6-6B45F3E61611");
            // Attrib for BlockType: Link List Lava:Lava Template
            RockMigrationHelper.AddBlockTypeAttribute("BBA9210E-80E1-486A-822D-F8842FE09F99", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Lava Template", "LavaTemplate", "", "Lava template to use to display content", 1, @"
<div class=""panel panel-block""> 
    <div class=""panel-heading"">
        <h4 class=""panel-title"">Links</h4>
        {% if AllowedActions.Edit == true %}
            <span class=""pull-right""><a href=""#"" onclick=""{{ '' | Postback:'EditList' }}""><i class='fa fa-gear'></i></a></span>
        {% endif %}
    </div>
    <div class=""block-content"">
        <ul class='list-group list-group-panel'>
        {% for definedValue in DefinedValues %}
            {% assign IsLink = definedValue | Attribute:'IsLink','RawValue' %}
            {% if IsLink == 'True' %}
                <li class='list-group-item'><a href='{{ definedValue.Description }}'>{{ definedValue.Value }}</a></li>
            {% else %}
                <li class='list-group-item'><h4 class='list-group-item-heading'>{{ definedValue.Value }}</h4></li>
            {% endif %}
        {% endfor %}
        </ul>
    </div>
</div>
", "37758E21-23CB-4836-AAF6-1AAD9E36198F");

            RockMigrationHelper.AddDefinedType("Link Lists", "Links", "Default list of links used by the 'Link List Lava' block.", "7E7969BD-945C-4472-8A80-889EF5833776");
            RockMigrationHelper.AddDefinedTypeAttribute("7E7969BD-945C-4472-8A80-889EF5833776", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Is Link", "IsLink", "Is this item a Link (vs. Heading)?", 0, "true", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2");
            RockMigrationHelper.AddAttributeQualifier("2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "truetext", "Yes", "D56ECD08-DB47-47D3-ABF8-5A7A1229A80E");
            RockMigrationHelper.AddAttributeQualifier("2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "falsetext", "No", "94148AD8-0234-4C0D-BF55-EC7133A954F2");

            RockMigrationHelper.AddDefinedValue("7E7969BD-945C-4472-8A80-889EF5833776", "Rock", "", "69B8FE33-F2FA-4619-9C9B-CC4ABB81D6FC", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("69B8FE33-F2FA-4619-9C9B-CC4ABB81D6FC", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "False");

            RockMigrationHelper.AddDefinedValue("7E7969BD-945C-4472-8A80-889EF5833776", "Website", "http://www.rockrms.com", "FD1FBDFF-691C-4A7F-A1BC-E5B91206520B", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("FD1FBDFF-691C-4A7F-A1BC-E5B91206520B", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "True");

            RockMigrationHelper.AddDefinedValue("7E7969BD-945C-4472-8A80-889EF5833776", "Documentation", "http://www.rockrms.com/Learn/Documentation", "FE0B4254-46F5-4FE6-87D9-0482A1BB4E84", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("FE0B4254-46F5-4FE6-87D9-0482A1BB4E84", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "True");

            RockMigrationHelper.AddDefinedValue("7E7969BD-945C-4472-8A80-889EF5833776", "Questions", "http://www.rockrms.com/Rock/Ask", "1A40715B-7B4D-42CE-8CBC-C76DDE67BED1", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("1A40715B-7B4D-42CE-8CBC-C76DDE67BED1", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "True");

            RockMigrationHelper.AddDefinedValue("7E7969BD-945C-4472-8A80-889EF5833776", "Community", "http://www.rockrms.com/slack", "755D4091-253E-499B-AB15-A7E86BF423F1", false);
            RockMigrationHelper.AddDefinedValueAttributeValue("755D4091-253E-499B-AB15-A7E86BF423F1", "2D3317AE-00CE-47E9-92A2-D28DDE72DBB2", "True");
        }