Beispiel #1
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // add global attribute for boosting universal search models
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.KEY_VALUE_LIST, "", "", "Universal Search Index Boost", "Allows you to boost certain universal search indexes.", 1000, "", "757F912F-55E0-76A9-46D2-345BB61D7B02", "UniversalSearchIndexBoost");

            // Add Fundraising Page/Block
            RockMigrationHelper.AddPage(true, "4E237286-B715-4109-A578-C1445EC02707", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Fundraising", "", "3E0F2EF9-DC32-4DFD-B213-A410AE5B6AB7", "");   // Site:Rock RMS
            RockMigrationHelper.UpdateBlockType("Fundraising Progress", "Progress for all people in a fundraising opportunity", "~/Blocks/Fundraising/FundraisingProgress.ascx", "Fundraising", "75D2BC14-34DF-42EA-8DBB-3F5294B290A9");
            // Add Block to Page: Fundraising, Site: Rock RMS
            RockMigrationHelper.AddBlock(true, "3E0F2EF9-DC32-4DFD-B213-A410AE5B6AB7", "", "75D2BC14-34DF-42EA-8DBB-3F5294B290A9", "Fundraising Progress", "Main", @"", @"", 0, "59A24C5E-8214-4F84-AE4C-648B3C5E3975");

            // Group List Page setting inside Group Detail Block
            // Attrib for BlockType: Group Detail:Group List Page
            RockMigrationHelper.UpdateBlockTypeAttribute("582BEEA1-5B27-444D-BC0A-F60CEB053981", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Group List Page", "GroupListPage", "", "The page to display related Group List.", 11, @"", "4F55D7DD-27A4-4ABC-89AD-1160F5697FD2");

            // Attrib Value for Block:Security Roles Detail, Attribute:Group List Page Page: Security Roles Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("B58919B6-0947-4FE6-A9AE-FB28194643E7", "4F55D7DD-27A4-4ABC-89AD-1160F5697FD2", @"d9678fef-c086-4232-972c-5dbac14bfee6");

            // Attrib Value for Block:Application Group Detail, Attribute:Group List Page Page: Application Group Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("64EEA884-8D04-44A3-9C75-5523A9EB9175", "4F55D7DD-27A4-4ABC-89AD-1160F5697FD2", @"ba078bb8-7205-46f4-9530-b2fb9ead3e57");

            // Fundraising Progress setting in Group Detail Block
            // Attrib for BlockType: Group Detail:Fundraising Progress Page
            RockMigrationHelper.UpdateBlockTypeAttribute("582BEEA1-5B27-444D-BC0A-F60CEB053981", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Fundraising Progress Page", "FundraisingProgressPage", "", "The page to display fundraising progress for all its members.", 11, @"", "8C2AF872-C75A-41ED-8C22-76B472B18655");
            // Attrib Value for Block:GroupDetailRight, Attribute:Fundraising Progress Page Page: Group Viewer, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("88344FE3-737E-4741-A38D-D2D3A1653818", "8C2AF872-C75A-41ED-8C22-76B472B18655", @"3e0f2ef9-dc32-4dfd-b213-a410ae5b6ab7");
            // Attrib Value for Block:Security Roles Detail, Attribute:Fundraising Progress Page Page: Security Roles Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("B58919B6-0947-4FE6-A9AE-FB28194643E7", "8C2AF872-C75A-41ED-8C22-76B472B18655", @"3e0f2ef9-dc32-4dfd-b213-a410ae5b6ab7");
            // Attrib Value for Block:Application Group Detail, Attribute:Fundraising Progress Page Page: Application Group Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("64EEA884-8D04-44A3-9C75-5523A9EB9175", "8C2AF872-C75A-41ED-8C22-76B472B18655", @"3e0f2ef9-dc32-4dfd-b213-a410ae5b6ab7");
            // Attrib Value for Block:Group Detail, Attribute:Fundraising Progress Page Page: Org Chart, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("C1B5CA27-8B5B-4D7F-9160-916EFAAA7D26", "8C2AF872-C75A-41ED-8C22-76B472B18655", @"3e0f2ef9-dc32-4dfd-b213-a410ae5b6ab7");
        }
Beispiel #2
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddGlobalAttribute(
                SystemGuid.FieldType.INTEGER,
                null,
                null,
                "Password Attempt Window",
                "The number of minutes after a user's first unsuccessful login that the user can be locked out. After this window of time, those failed logins will be forgiven. Set to 0 to disable user lockouts.",
                0,
                "1",
                AttemptWindowGuid,
                "PasswordAttemptWindow",
                false);

            RockMigrationHelper.AddGlobalAttribute(
                SystemGuid.FieldType.INTEGER,
                null,
                null,
                "Max Invalid Password Attempts",
                "The number of invalid login attempts by a user, within the Password Attempt Window, before the user's account is locked.",
                0,
                "20",
                MaxAttemptsGuid,
                "MaxInvalidPasswordAttempts",
                false);
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            AddColumn("dbo.RegistrationTemplate", "AllowGroupPlacement", c => c.Boolean(nullable: false));

            RockMigrationHelper.UpdateBlockType("Dynamic Chart", "Block to display a chart using SQL as the chart datasource", "~/Blocks/Reporting/DynamicChart.ascx", "Reporting", "7BCCBFB0-26A5-4376-B1F3-DC6ADD7C3723");
            RockMigrationHelper.UpdateBlockType("Dynamic Heat Map", "Block to a map of the locations of people", "~/Blocks/Reporting/DynamicHeatMap.ascx", "Reporting", "FAFBB883-D0B4-498E-91EE-CAC5652E5095");

            RockMigrationHelper.AddBlockTypeAttribute("4D6B686A-79DF-4EFC-A8BA-9841C248BF74", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Prayer Count", "ShowPrayerCount", "", "If enabled, the block will show the current prayer count for each request in the list.", 2, @"False", "0BD12941-651E-421E-9A14-3740593C843F");

            // add new global attribute to determine email link preference
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.SINGLE_SELECT, "", "", "Preferred Email Link Type", "The type of link you prefer email links to use. 'New Communication' will link to the new communication page, while 'Mailto' will use a mailto tag which will take the user to their configured mail client.", 99, "1", "F1BECEF9-1047-E89F-4CC8-8F856750E5D0");
            Sql(@"  
    DECLARE @EmailLinkAttributeId int = (SELECT TOP 1 [Id] FROM [Attribute] WHERE [Guid] = 'F1BECEF9-1047-E89F-4CC8-8F856750E5D0')

    INSERT INTO [AttributeQualifier] 
	    ([IsSystem], [AttributeId], [Key], [Value], [Guid])
	    VALUES
		    (0, @EmailLinkAttributeId, 'fieldtype', 'ddl', newid())

    INSERT INTO [AttributeQualifier] 
	    ([IsSystem], [AttributeId], [Key], [Value], [Guid])
	    VALUES
		    (0, @EmailLinkAttributeId, 'values', '1^New Communication,2^Mailto', newid())
");
        }
Beispiel #4
0
        public override void Up()
        {
            // Add the global attribute
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.KEY_VALUE_LIST, null, null, "OAuth Settings", "Settings for the OAuth server plugin.", 0, "OAuthRequireSsl^True|OAuthAuthorizePath^/OAuth/Authorize|OAuthLoginPath^/OAuth/Login|OAuthLogoutPath^/OAuth/Logout|OAuthTokenPath^/OAuth/Logout|OAuthTokenPath^/OAuth/Token|OAuthTokenLifespan^60", "9A85BBE0-ECC2-4A81-990F-D9318AE36DA9");
            Sql("INSERT INTO [dbo].[AttributeCategory] (AttributeId, CategoryId) SELECT Id, 5 from [dbo].[attribute] WHERE GUID = '9A85BBE0-ECC2-4A81-990F-D9318AE36DA9';");

            // Now create the site.  Thanks Mark!
            RockMigrationHelper.AddSite("OAuth", "OAuth server portal.", "Stark", "92A541DB-F88C-4EEA-B015-B67497C5B2A0");                                                                                         //Site: OAuth
            RockMigrationHelper.AddLayout("92A541DB-F88C-4EEA-B015-B67497C5B2A0", "FullWidth", "FullWidth", "", "7823E618-D769-461E-BF21-42E71A0FBAD5");                                                           // Site:OAuth
            // Page: OAuth Portal
            RockMigrationHelper.AddPage("", "7823E618-D769-461E-BF21-42E71A0FBAD5", "OAuth Portal", "OAuth authentication portal", "49F0DBFB-F2D7-4494-8E39-F7DDE4206336", "");                                    // Site:OAuth
            // Page: OAuth Login
            RockMigrationHelper.AddPage("49F0DBFB-F2D7-4494-8E39-F7DDE4206336", "7823E618-D769-461E-BF21-42E71A0FBAD5", "OAuth Login", "OAuth Login Page", "E9D51B46-09B8-4086-B499-9C613B11FE3C", "");            // Site:OAuth
            // Page: OAuth Authorization
            RockMigrationHelper.AddPage("49F0DBFB-F2D7-4494-8E39-F7DDE4206336", "7823E618-D769-461E-BF21-42E71A0FBAD5", "OAuth Authorization", "OAuth Authorization", "DA7D63B0-73A8-4321-AB3F-AC041F67E85B", ""); // Site:OAuth
            // Page: OAuth Logout
            RockMigrationHelper.AddPage("49F0DBFB-F2D7-4494-8E39-F7DDE4206336", "7823E618-D769-461E-BF21-42E71A0FBAD5", "OAuth Logout", "", "82903D44-A105-4B40-BEB3-2D7F55536F4A", "");                           // Site:OAuth
            RockMigrationHelper.AddPageRoute("E9D51B46-09B8-4086-B499-9C613B11FE3C", "OAuth/Login");
            RockMigrationHelper.AddPageRoute("DA7D63B0-73A8-4321-AB3F-AC041F67E85B", "OAuth/Authorize");
            RockMigrationHelper.AddPageRoute("DA7D63B0-73A8-4321-AB3F-AC041F67E85B", "OAuth/Token");
            RockMigrationHelper.AddPageRoute("DA7D63B0-73A8-4321-AB3F-AC041F67E85B", "OAuth/Logout");
            RockMigrationHelper.UpdateBlockType("HTML Content", "Adds an editable HTML fragment to the page.", "~/Blocks/Cms/HtmlContentDetail.ascx", "CMS", "19B61D65-37E3-459F-A44F-DEF0089118A3");                                                                   //Block Type: HTML Content
            RockMigrationHelper.UpdateBlockType("OAuth Authorize", "Check to make sure the user has authorized this OAuth request (or prompt for permissions).", "~/Plugins/org_secc/OAuth/Authorize.ascx", "SECC > Security", "ED369489-5844-4BE5-8ACE-18A75F9E805C"); //Block Type: OAuth Authorize
            RockMigrationHelper.UpdateBlockType("OAuth Login", "Prompts user for login credentials during the OAuth Login process.", "~/Plugins/org_secc/OAuth/Login.ascx", "SECC > Security", "79698895-30F1-46A9-85D4-B6C55681781F");                                 //Block Type: OAuth Login
            RockMigrationHelper.UpdateBlockType("OAuth Logout", "Logs a user out of Rock/OAuth.", "~/Plugins/org_secc/OAuth/Logout.ascx", "SECC > Security", "C7F3107B-3FAD-459E-9B93-6F71A42A478C");                                                                   //Block Type: OAuth Logout
            RockMigrationHelper.AddBlock("E9D51B46-09B8-4086-B499-9C613B11FE3C", "", "79698895-30F1-46A9-85D4-B6C55681781F", "OAuth Login", "Main", "", "", 0, "F4CAB049-7B40-49E5-BBA6-4F69BB8CDC17");                                                                 //Block of Type: OAuth Login
            RockMigrationHelper.AddBlock("DA7D63B0-73A8-4321-AB3F-AC041F67E85B", "", "ED369489-5844-4BE5-8ACE-18A75F9E805C", "OAuth Login", "Main", "", "", 0, "69946856-0950-468C-9853-A887AAB95201");                                                                 //Block of Type: OAuth Authorize
            RockMigrationHelper.AddBlock("82903D44-A105-4B40-BEB3-2D7F55536F4A", "", "C7F3107B-3FAD-459E-9B93-6F71A42A478C", "OAuth Logout", "Main", "", "", 0, "F618AE9E-71E2-4831-BB72-291E90773C0B");                                                                //Block of Type: OAuth Logout
            RockMigrationHelper.AddBlock("82903D44-A105-4B40-BEB3-2D7F55536F4A", "", "19B61D65-37E3-459F-A44F-DEF0089118A3", "Logout Content", "Main", "", "", 1, "0D6ADD3D-11BB-48F3-9641-EF122B0C3879");                                                              //Block of Type: HTML Content
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "3549BAB6-FE1B-4333-AFC4-C5ACA01BB8EB", "Entity Type", "ContextEntityType", "", "The type of entity that will provide context for this block", 0, @"", "6783D47D-92F9-4F48-93C0-16111D675A0F");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Use Code Editor", "UseCodeEditor", "", "Use the code editor instead of the WYSIWYG editor", 0, @"True", "0673E015-F8DD-4A52-B380-C758011331B2");
            RockMigrationHelper.AddBlockTypeAttribute("ED369489-5844-4BE5-8ACE-18A75F9E805C", "9C204CD0-1233-41C5-818A-C5DA439445AA", "OAuth Config Attribute Key", "OAuthConfigAttributeKey", "", "The OAuth Configuration Attribute\"s Key", 0, @"OAuthSettings", "ED073B5F-BFBA-4DA2-9EBB-5833D15A1A50");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "New Account Page", "NewAccountPage", "", "Page to navigate to when user selects \"Create New Account\" (if blank will use \"NewAccountPage\" page route)", 0, @"", "1D6B6904-85F1-4270-90AC-B2B45A46283A");
            RockMigrationHelper.AddBlockTypeAttribute("C7F3107B-3FAD-459E-9B93-6F71A42A478C", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enabled", "Enabled", "", "Enabled or disabled.  This is helpful for editing the page!", 0, @"True", "96247DCE-CE08-4E03-871F-9829BD652016");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Help Page", "HelpPage", "", "Page to navigate to when user selects \"Help\" option (if blank will use \"ForgotUserName\" page route)", 1, @"", "6208B5DE-42FF-46E9-B295-E1AA1C18F358");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Document Root Folder", "DocumentRootFolder", "", "The folder to use as the root when browsing or uploading documents.", 1, @"~/Content", "3BDB8AED-32C5-4879-B1CB-8FC7C8336534");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Image Root Folder", "ImageRootFolder", "", "The folder to use as the root when browsing or uploading images.", 2, @"~/Content", "26F3AFC6-C05B-44A4-8593-AFE1D9969B0E");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Confirm Caption", "ConfirmCaption", "", "The text (HTML) to display when a user\"s account needs to be confirmed.", 2, @"
Thank-you for logging in, however, we need to confirm the email associated with this account belongs to you. We've sent you an email that contains a link for confirming.  Please click the link in your email to continue.
", "9E0AB758-7710-469C-B823-0FB88237622D");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Confirmation Page", "ConfirmationPage", "", "Page for user to confirm their account (if blank will use \"ConfirmAccount\" page route)", 3, @"", "B3C062BC-80A1-48D3-B78E-97EA821CD469");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "User Specific Folders", "UserSpecificFolders", "", "Should the root folders be specific to current user?", 3, @"False", "9D3E4ED9-1BEF-4547-B6B0-CE29FE3835EE");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Cache Duration", "CacheDuration", "", "Number of seconds to cache the content.", 4, @"3600", "4DFDB295-6D0F-40A1-BEF9-7B70C56F66C4");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "08F3003B-F3E2-41EC-BDF1-A2B7AC2908CF", "Confirm Account Template", "ConfirmAccountTemplate", "", "Confirm Account Email Template", 4, @"17aaceef-15ca-4c30-9a3a-11e6cf7e6411", "31D61FE4-44E9-4534-AF73-C449E1D52B2E");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Locked Out Caption", "LockedOutCaption", "", "The text (HTML) to display when a user\"s account has been locked.", 5, @"
Sorry, your account has been locked.  Please contact our office at {{ 'Global' | Attribute:'OrganizationPhone' }} or email {{ 'Global' | Attribute:'OrganizationEmail' }} to resolve this.  Thank-you. 
", "319313C7-9174-4A67-A702-7F8A31F6C541");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Context Parameter", "ContextParameter", "", "Query string parameter to use for \"personalizing\" content based on unique values.", 5, @"", "3FFC512D-A576-4289-B648-905FD7A64ABB");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "9C204CD0-1233-41C5-818A-C5DA439445AA", "Context Name", "ContextName", "", "Name to use to further \"personalize\" content.  Blocks with the same name, and referenced with the same context parameter will share html values.", 6, @"", "466993F7-D838-447A-97E7-8BBDA6A57289");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Hide New Account Option", "HideNewAccount", "", "Should \"New Account\" option be hidden?  For site\"s that require user to be in a role (Internal Rock Site for example), users shouldn\"t be able to create their own account.", 6, @"False", "184ADC67-2348-4AE1-ADE9-8A2AF9AC0460");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "9C204CD0-1233-41C5-818A-C5DA439445AA", "New Account Text", "NewAccountButtonText", "", "The text to show on the New Account button.", 7, @"Register", "C1F1C06E-CAE1-4442-80BB-CCE8651949FA");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enable Versioning", "SupportVersions", "", "If checked, previous versions of the content will be preserved. Versioning is required if you want to require approval.", 7, @"False", "7C1CE199-86CF-4EAE-8AB3-848416A72C58");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Require Approval", "RequireApproval", "", "Require that content be approved?", 8, @"False", "EC2B701B-4C1D-4F3F-9C77-A73C75D7FF7A");
            RockMigrationHelper.AddBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Enable Debug", "EnableDebug", "", "Show lava merge fields.", 9, @"False", "48FF43A9-8E12-4768-80A9-88FBB81F11D8");
            RockMigrationHelper.AddBlockTypeAttribute("79698895-30F1-46A9-85D4-B6C55681781F", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Prompt Message", "PromptMessage", "", "Optional text (HTML) to display above username and password fields.", 9, @"", "4FA058BF-A24D-460B-BC9A-E6FAB1C8A653");
            RockMigrationHelper.AddBlockAttributeValue("F618AE9E-71E2-4831-BB72-291E90773C0B", "96247DCE-CE08-4E03-871F-9829BD652016", @"True");                              // Enabled
            RockMigrationHelper.UpdateHtmlContentBlock("0D6ADD3D-11BB-48F3-9641-EF122B0C3879", @"You have successfully logged out!", "CC8CEB43-A860-46B5-8160-9F0CF5641A6C"); //HTML Content
        }
Beispiel #5
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddGlobalAttribute("1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "", "", "Enable Auditing", "Enable the saving of audit information for every row/field change made in Rock.", 0, "false", "66B13C02-CBA0-4427-9D60-8B331A51CC96");

            Sql(@"
    UPDATE[SystemEmail]
    SET[Body] = REPLACE( [Body], '?GroupId={{ Group.Id }}&Occurrence=', '?{{ Person.ImpersonationParameter }}&GroupId={{ Group.Id }}&Occurrence=' )
    WHERE[Guid] = 'ED567FDE-A3B4-4827-899D-C2740DF3E5DA'

    UPDATE [__MigrationHistory] SET [Model] = 0x

");
        }
        /// <summary>
        /// Creates the content white list global attribute and adds it to the Config category.
        /// </summary>
        private void CreateContentWhiteList()
        {
            RockMigrationHelper.AddGlobalAttribute("9C204CD0-1233-41C5-818A-C5DA439445AA", "", "", "Content Filetype Whitelist", "A comma or semicolon separated list of file types that are allowed to be uploaded to the file system. If left blank then all files are allowed unless they are in \"Content Filetype Blacklist\". Filetypes in this list have a lower preference then the ones in \"Content Filetype Blacklist\". i.e. if a file type exists in both lists then it will not be allowed. This list does not prevent files from uploading as a binary file type which is saved to the database.", 0, "", SystemGuid.Attribute.CONTENT_FILETYPE_WHITELIST, "ContentFiletypeWhitelist", false);

            // Add the Content Filetype Whitelist to the config category
            Sql(@"
                DECLARE @attributeId INT = (SELECT [Id] FROM [Attribute] WHERE [Guid] = 'B895B6D7-BA21-45C0-8913-EF47FAAD69B1')

                DELETE FROM [AttributeCategory] WHERE [AttributeId] = @attributeId

                INSERT INTO [AttributeCategory] ([AttributeId], [CategoryId])
                VALUES(@attributeId, 5)");
        }
Beispiel #7
0
        /// <summary>
        /// Operations to be performed during the downgrade process.
        /// </summary>
        public override void Down()
        {
            RockMigrationHelper.AddGlobalAttribute("C28C7BF3-A552-4D77-9408-DEDCF760CED0", "", "", "Safe Sender Domains", "Delimited list of domains that can be used to send emails.  If an Email communication is created with a From Address that is not from one of these domains, the Organization Email global attribute value will be used instead for the From Address and the original value will be used as the Reply To address.  This is to help reduce the likelihood of communications being rejected by the receiving email servers.", 0, "", "CDD29C51-5D33-435F-96AB-2C06BA772F88");
            RockMigrationHelper.DeleteBlockAttributeValue("74583AD9-36F5-44CE-9346-AA009440A49A", "0305EF98-C791-4626-9996-F189B9BB674C");
            RockMigrationHelper.DeleteBlockAttributeValue("840878A8-6CFF-4A9E-B9E7-48D33E37959C", "9280D61F-C4F3-4A3E-A9BB-BCD67FF78637");
            RockMigrationHelper.DeleteBlock("840878A8-6CFF-4A9E-B9E7-48D33E37959C");
            RockMigrationHelper.DeleteBlock("74583AD9-36F5-44CE-9346-AA009440A49A");
            RockMigrationHelper.DeletePage("B90576B0-110E-4DC0-8EB8-4668C5238508");
            RockMigrationHelper.DeleteDefinedType("DB91D0E9-DCA6-45A9-8276-AEF032BE8AED");

            DropForeignKey("dbo.WorkflowActivity", "ActivatedByActivityId", "dbo.WorkflowActivity");
            DropIndex("dbo.WorkflowActivity", new[] { "ActivatedByActivityId" });
            DropColumn("dbo.WorkflowActivity", "ActivatedByActivityId");
        }
Beispiel #8
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // Drop views that were pointing to AnalyticsDimDate and re-create them after the rename
            Sql(@"
IF OBJECT_ID(N'[dbo].[AnalyticsDimAttendanceDate]', 'V') IS NOT NULL
    DROP VIEW [dbo].AnalyticsDimAttendanceDate
GO

IF OBJECT_ID(N'[dbo].[AnalyticsDimFinancialTransactionDate]', 'V') IS NOT NULL
    DROP VIEW [dbo].AnalyticsDimFinancialTransactionDate
GO

IF OBJECT_ID(N'[dbo].[AnalyticsDimPersonBirthDate]', 'V') IS NOT NULL
    DROP VIEW [dbo].AnalyticsDimPersonBirthDate
GO
");

            RenameTable(name: "dbo.AnalyticsDimDate", newName: "AnalyticsSourceDate");


            Sql(MigrationSQL._201709191729044_Analytics2_AnalyticsDimAttendanceDate);
            Sql(MigrationSQL._201709191729044_Analytics2_AnalyticsDimFamilyHeadOfHouseholdBirthDate);
            Sql(MigrationSQL._201709191729044_Analytics2_AnalyticsDimFinancialTransactionDate);
            Sql(MigrationSQL._201709191729044_Analytics2_AnalyticsDimPersonCurrentBirthDate);
            Sql(MigrationSQL._201709191729044_Analytics2_AnalyticsDimPersonHistoricalBirthDate);

            // DT: vCard Format
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.CODE_EDITOR, "", "", "vCard Format", "Lava format to use when creating a vCard for a person", 0, @"
BEGIN:VCARD
VERSION:2.1
N:{{ Person.LastName }};{{ Person.NickName }}
FN:{{ Person.FullName }} 
{% assign cellPhone = Person | PhoneNumber:''Mobile'', true %}{% if cellPhone and cellPhone != '''' %}TEL;PREF;CELL:{{ cellPhone }}{% endif %}
{% assign homePhone = Person | PhoneNumber:''Home'', true %}{% if homePhone and homePhone != '''' %}TEL;HOME:{{ homePhone }}{% endif %}
{% assign workPhone = Person | PhoneNumber:''Work'', true %}{% if workPhone and workPhone != '''' %}TEL;WORK:{{ workPhone }}{% endif %}
{% if Person.Email and Person.Email != '''' %}EMAIL;PREF;HOME:{{ Person.Email}}{% endif %}
{{ Person | Address:''Home'',''ADR;HOME;PREF:;;[[Street1]];[[City]];[[State]];[[PostalCode]]'' }}
{{ Person | Address:''Work'',''ADR;WORK:;;[[Street1]];[[City]];[[State]];[[PostalCode]]'' }}
{% assign employer = Person | Attribute:''Employer'' %}{% if employer and employer != '''' %}ORG:{{ employer }}{% endif %}
{% assign position = Person | Attribute:''Position'' %}{% if position and position != '''' %}TITLE:{{ position }}{% endif %}
{% if Person.PhotoId %}PHOTO;ENCODING=BASE64;TYPE=JPEG:{{ Person.PhotoId | Base64Encode:''h=92&w=92&mode=max&format=jpg'' }}{% endif %}


END:VCARD
", "DC0C0ED9-3347-4EBA-A6B5-CC5A8F547F92", "VCardFormat");
            RockMigrationHelper.AddAttributeQualifier("DC0C0ED9-3347-4EBA-A6B5-CC5A8F547F92", "editorHeight", "400", "41C08E15-2B78-4F50-9BC6-5A3217B542BD");
            RockMigrationHelper.AddAttributeQualifier("DC0C0ED9-3347-4EBA-A6B5-CC5A8F547F92", "editorMode", "3", "C28D3C9C-586B-40F2-BDEA-5BF67F2ED0C9");
            RockMigrationHelper.AddAttributeQualifier("DC0C0ED9-3347-4EBA-A6B5-CC5A8F547F92", "editorTheme", "0", "A07ED4B6-9391-459A-AA4D-472926F259C9");
        }
Beispiel #9
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddGlobalAttribute(
                "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0",
                string.Empty,
                string.Empty,
                "Same Site Cookie Setting",
                "SameSite Setting",
                @"This setting is to protect Rock from Cross Site Request Forgery attacks by restricting the websites that have access to the Rock cookie. If this setting is changed then it will be applied to each user as they log in.  The ""Strict"" setting will keep the browser from sending the Rock cookie to any other domains, while the ""Lax"" setting provides a balance between security and usability. In most cases the ""Lax"" setting is appropriate.",
                1033,
                "Lax",
                Rock.SystemGuid.Attribute.SAME_SITE_COOKIE_SETTING,
                "core_SameSiteCookieSetting",
                false
                );

            RockMigrationHelper.AddAttributeQualifier(Rock.SystemGuid.Attribute.SAME_SITE_COOKIE_SETTING, "values", "None,Lax,Strict", "BDDC44B7-DBBA-48BC-8EE5-D9D17D28FAB8");
        }
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddGlobalAttribute("1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "", "", "Enable Auditing", "Enable the saving of audit information for every row/field change made in Rock.", 0, "false", "66B13C02-CBA0-4427-9D60-8B331A51CC96");

            Sql(@"
    CREATE NONCLUSTERED INDEX [IX_LocationId_ScheduleId_GroupId_StartDateTime] ON [dbo].[Attendance]
    (
	    [LocationId] ASC,
	    [ScheduleId] ASC,
	    [GroupId] ASC,
	    [StartDateTime] ASC
    )
    INCLUDE (   
        [DidAttend],
	    [PersonAliasId],
	    [DidNotOccur]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // add new field type
            RockMigrationHelper.UpdateFieldType("Lava Commands", "Used to select Lava commands.", "Rock", "Rock.Field.Types.LavaCommandsFieldType", Rock.SystemGuid.FieldType.LAVA_COMMANDS);

            // add security to lava rest enpoint
            Sql(@"IF NOT EXISTS (SELECT [Id] FROM [RestController] WHERE [ClassName] = 'Rock.Rest.Controllers.LavaController') 
	INSERT INTO [RestController] ( [Name], [ClassName], [Guid] )
		VALUES ( 'Lava', 'Rock.Rest.Controllers.LavaController', NEWID() )

		
IF NOT EXISTS (SELECT [Id] FROM [RestAction] WHERE [ApiId] = 'POSTapi/Lava/RenderTemplate?template={template}') 
	INSERT INTO [RestAction] ( [ControllerId], [Method], [ApiId], [Path], [Guid] )
		SELECT [Id], 'POST', 'POSTapi/Lava/RenderTemplate?template={template}', 'api/Lava/RenderTemplate?template={template}', NEWID()
		FROM [RestController] WHERE [ClassName] = 'Rock.Rest.Controllers.LavaController'


INSERT INTO [Auth] ( [EntityTypeId], [EntityId], [Order], [Action], [AllowOrDeny], [SpecialRole], [GroupId], [Guid] ) 
	VALUES (
		(SELECT [Id] FROM [EntityType] WHERE [Guid] = 'D4F7F055-5351-4ADF-9F8D-4802CAD6CC9D'), 
		(SELECT [Id] FROM [RestAction] WHERE [ApiId] = 'POSTapi/Lava/RenderTemplate?template={template}'), 
		0, 'View', 'D', 1, 
		NULL, 
		'0BC9F7C3-C3FF-C39E-4EC3-1A06F5E5090B')"        );

            // create Global Attribute for lava security
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.LAVA_COMMANDS, "", "", "Default Enabled Lava Commands", "Allows you to globally enable/disable Lava Commands.", 0, "", SystemGuid.Attribute.GLOBAL_ENABLED_LAVA_COMMANDS);

            // add attribute value
            Sql(@"DECLARE @AttributeId int = (SELECT TOP 1 [Id] FROM [Attribute] WHERE [Guid] = '933CFB7D-C9E1-BDAE-40AD-231002A91626')
INSERT INTO [AttributeValue]
([AttributeId], [EntityId], [Value], [Guid], [IsSystem])
VALUES
(@AttributeId, null, 'RockEntity', '503A02A4-A104-C1A9-4848-E98283307EB2', 1)");

            // add category to  attribute
            Sql(@"DECLARE @ConfigCategoryId int = (SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = 'BB40B563-18D1-4133-94B9-D7F67D95E4E3')
  DECLARE @LavaSecAttributeId int = (SELECT TOP 1 [Id] FROM [Attribute] WHERE [Guid] = '933CFB7D-C9E1-BDAE-40AD-231002A91626')

  INSERT INTO [AttributeCategory] 
	([AttributeId], [CategoryId])
  VALUES
	(@LavaSecAttributeId, @ConfigCategoryId)"    );
        }
        /// <summary>
        /// DL: Add Lava Engine Framework Setting
        /// </summary>
        private void UpLavaEngineSystemSettings()
        {
            RockMigrationHelper.AddGlobalAttribute(
                Rock.SystemGuid.FieldType.SINGLE_SELECT,
                string.Empty,
                string.Empty,
                "Lava Engine Liquid Framework",
                "Lava Engine Framework",
                @"The Liquid rendering framework used by the Lava Engine to parse and render templates. 'Default' ensures that the currently recommended framework is always used. Changes to this setting will not take effect until Rock is restarted.",
                0,
                "Default",
                GLOBAL_LAVA_ENGINE_LIQUID_FRAMEWORK,
                LAVA_ENGINE_LIQUID_FRAMEWORK,
                false
                );

            RockMigrationHelper.AddAttributeQualifier(GLOBAL_LAVA_ENGINE_LIQUID_FRAMEWORK, "fieldtype", "ddl", "B4C0B3BC-3416-402F-8874-CD5D33CEB5AD");
            RockMigrationHelper.AddAttributeQualifier(GLOBAL_LAVA_ENGINE_LIQUID_FRAMEWORK, "values", "Default^Default,RockLiquid^RockLiquid,DotLiquid^DotLiquid,Fluid^Fluid", "E11456FF-F57B-4964-877E-85468971C238");
        }
Beispiel #13
0
        private void AddRockLogSystemSettings()
        {
            var defaultRockLogSystemSettings = new RockLogSystemSettings
            {
                DomainsToLog     = new System.Collections.Generic.List <string>(),
                LogLevel         = RockLogLevel.Off,
                NumberOfLogFiles = 20,
                MaxFileSize      = 20
            };

            var serializedRockLog = defaultRockLogSystemSettings.ToJson();

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT,
                                                   Rock.Model.Attribute.SYSTEM_SETTING_QUALIFIER,
                                                   string.Empty,
                                                   SystemSetting.ROCK_LOGGING_SETTINGS,
                                                   "Rock Logging System Settings",
                                                   0,
                                                   serializedRockLog,
                                                   SystemGuid.Attribute.DEFINED_VALUE_LOG_SYSTEM_SETTINGS,
                                                   SystemSetting.ROCK_LOGGING_SETTINGS);
        }
        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");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            Sql(@"
/*
<doc>
	<summary>
        This function returns the groupmembers of selected group type that geofences a person 
	</summary>

	<returns>
		Group Names
	</returns>
	<remarks>
		This function allows you to request the groupmebmers for those groups of a specific type
		that have one or more locations with a geofence that surrounds any of the given persons
		addresses that have the is mapped location
	</remarks>
	<code>
		SELECT [dbo].[ufnGroup_GetGeofencingGroupMembers](2, 24, 26)
	</code>
</doc>
*/

CREATE FUNCTION [dbo].[ufnGroup_GeofencingGroupMembers](
	@PersonId int, 
	@GroupTypeId int,
	@GroupTypeRoleId int
) 
RETURNS TABLE AS

RETURN 
(
	WITH CTE1 AS 
	(
		SELECT FL.[GeoPoint] AS [GeoPoint]
		FROM [GroupMember] M
		INNER JOIN [Group] F ON F.[Id] = M.[GroupId] 
		INNER JOIN [GroupType] FT ON FT.[Id] = F.[GroupTypeId]
		INNER JOIN [GroupLocation] FGL ON FGL.[GroupId] = F.[Id] AND FGL.[IsMappedLocation] = 1
		INNER JOIN [Location] FL ON FL.[Id] = FGL.[LocationId] AND FL.[GeoPoint] IS NOT NULL
		WHERE M.[PersonId] = @PersonId
		AND FT.[Guid] = '790E3215-3B10-442B-AF69-616C0DCB998E'	-- Family
	)

	SELECT M.*
	FROM [GroupMember] M
	INNER JOIN [Group] G ON G.[Id] = M.[GroupId]
	INNER JOIN [GroupLocation] GL ON GL.[GroupId] = G.[Id]
	INNER JOIN [Location] L ON L.[Id] = GL.[LocationId] AND L.[GeoFence] IS NOT NULL
	INNER JOIN CTE1 ON ((CTE1.[GeoPoint].STIntersects(L.[GeoFence])) = 1)
	WHERE G.[GroupTypeId] = @GroupTypeId
	AND M.[GroupRoleId] = @GroupTypeRoleId
)
");

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, string.Empty, string.Empty, "Valid Username Caption", "A user-friendly description of a valid username.", 0, "It must only contain letters, numbers, +, -, _, or @. It must also be at least three characters and less than 129.", "BDC62C21-9427-4E20-BC28-98E9EC1E189F", "core.ValidUsernameCaption");
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, string.Empty, string.Empty, "Valid Username Regular Expression", "A regular expression used to validate good, valid usernames.", 0, @"^[A-Za-z0-9+.@_-]{3,128}$", "FE1A18AF-0F3F-4B38-8F1B-158A7E23E81F", "core.ValidUsernameRegularExpression");

            Sql(@"
    -- Update family members to be active
    UPDATE M SET [GroupMemberStatus] = 1
    FROM [GroupMember] M
    INNER JOIN [Group] G ON G.[Id] = M.[GroupId]
    INNER JOIN [GroupType] T ON T.[Id] = G.[GroupTypeId]
    WHERE T.[Guid] = '790E3215-3B10-442B-AF69-616C0DCB998E'
    AND M.[GroupMemberStatus] = 0
");
        }
        /// <summary>
        /// The commands to run to migrate plugin to the specific version
        /// </summary>
        public override void Up()
        {
            RockMigrationHelper.AddPage(true, "567FFD63-53F9-4419-AD96-C2F07CAE09F1", "901926F9-AD81-41A4-9B1E-254F5B45E471", "Sermons", "", "9711DB54-0FB0-4722-AB45-1DFB6158F922", "fa fa-tv");       // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "567FFD63-53F9-4419-AD96-C2F07CAE09F1", "355F6C23-29B3-4976-AE43-30426BE12B99", "Visit", "", "CD8A05F8-24FF-4D38-8ED0-FE2BF07C0CDE", "fa fa-map-marker"); // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "567FFD63-53F9-4419-AD96-C2F07CAE09F1", "355F6C23-29B3-4976-AE43-30426BE12B99", "Connect", "", "DE6D125E-892E-4F10-A33D-F84942582B1E", "fa fa-link");     // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "567FFD63-53F9-4419-AD96-C2F07CAE09F1", "355F6C23-29B3-4976-AE43-30426BE12B99", "Give", "", "78EDFA36-FEC9-4D74-A34B-07C76A4FC071", "fa fa-heart");       // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "567FFD63-53F9-4419-AD96-C2F07CAE09F1", "60D99A36-8D00-467E-9993-3C2F0B249EBD", "Footer", "", "FF495C30-29C5-420C-A35B-E9E808EEBCEF", "");                // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "CD8A05F8-24FF-4D38-8ED0-FE2BF07C0CDE", "355F6C23-29B3-4976-AE43-30426BE12B99", "Visit Detail", "", "5F1E1759-0A3A-4A57-896B-7B8B8BD892B3", "");          // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "9711DB54-0FB0-4722-AB45-1DFB6158F922", "355F6C23-29B3-4976-AE43-30426BE12B99", "Series Detail", "", "4F8A1FFA-05A7-4522-8C23-74468FAFD6BC", "");         // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "4F8A1FFA-05A7-4522-8C23-74468FAFD6BC", "355F6C23-29B3-4976-AE43-30426BE12B99", "Sermon Detail", "", "1CDE2032-482B-483E-B273-A1A3B421E04C", "");         // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "4F8A1FFA-05A7-4522-8C23-74468FAFD6BC", "355F6C23-29B3-4976-AE43-30426BE12B99", "Sermon Detail Audio", "", "344BABC7-5C30-4B53-87F9-A00F0DDA38E7", "");   // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "DE6D125E-892E-4F10-A33D-F84942582B1E", "355F6C23-29B3-4976-AE43-30426BE12B99", "Groups", "", "D943417B-F167-4CD0-8321-C779B1C9E92B", "");                // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "DE6D125E-892E-4F10-A33D-F84942582B1E", "355F6C23-29B3-4976-AE43-30426BE12B99", "Baptism", "", "8E94B8E8-171D-4A81-9A69-D34667510231", "");               // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "DE6D125E-892E-4F10-A33D-F84942582B1E", "355F6C23-29B3-4976-AE43-30426BE12B99", "Events", "", "B95062A4-770C-47DF-B88F-0626F7BFDF2F", "");                // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Contact Us", "", "7817298D-0A76-4039-A5D7-AF273AC05952", "");            // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "B95062A4-770C-47DF-B88F-0626F7BFDF2F", "355F6C23-29B3-4976-AE43-30426BE12B99", "Event Detail", "", "14A25533-186B-49C4-A949-0F9DA864A87E", "");          // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "DE6D125E-892E-4F10-A33D-F84942582B1E", "355F6C23-29B3-4976-AE43-30426BE12B99", "Serve", "", "C90B1E1B-EC24-49E0-9562-7F92BB2D24AB", "");                 // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "DE6D125E-892E-4F10-A33D-F84942582B1E", "355F6C23-29B3-4976-AE43-30426BE12B99", "Other Blocks", "", "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "");          // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Login", "", "F53E2612-3E8B-4D26-87ED-468D4C9C02E6", "");                 // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Prayer Request", "", "BB61CCD2-9E50-45A3-9D94-A37F3D7313FF", "");        // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Person Card", "", "79EF0279-9800-4BAF-A8D9-DD42E6868BAA", "");           // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Group Attendance", "", "2FB9C8A1-B3E6-4608-8CE7-411AA27945BA", "");      // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Group List", "", "0EC21B17-EA03-450E-A0B4-594C09340458", "");            // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Group Member List", "", "C4A65B7E-D57C-44C9-93AD-9E2E51145481", "");     // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "355F6C23-29B3-4976-AE43-30426BE12B99", "Note Block", "", "F522A717-2D7A-405B-87BB-CCB16C15BB44", "");            // Site:KFS Avalanche
            RockMigrationHelper.AddPage(true, "D4A5C0AB-0A90-416F-9B3F-C0ACFED92D43", "901926F9-AD81-41A4-9B1E-254F5B45E471", "Webview Block", "", "0FBC5CE7-CF91-45EC-B28A-A5E486764B9A", "");         // Site:KFS Avalanche

            Sql(@"DECLARE @SiteId int = ( SELECT TOP 1 [Id] FROM [Site] WHERE [Guid] = '613631FF-D19C-4F9C-B163-E9331C4BA61B' )
                 DECLARE @LayoutIds TABLE (id int) 
                 INSERT INTO @LayoutIds 
                 SELECT [Id] FROM [Layout] WHERE [SiteId] = @SiteId
                 UPDATE [Page] SET [PageDisplayTitle] = 0 WHERE [LayoutId] IN (SELECT * FROM @LayoutIds)");

            RockMigrationHelper.UpdateFieldType("Action Item", "", "Avalanche", "Avalanche.Field.Types.ActionItemFieldType", "E5A6D6C7-DAB4-4EFA-B76F-E22AFEC5158D");

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, "", "", "Avalanche Footer Page", "Page Id of footer blocks/layout configuration", 0, "", "1B8B1811-D82F-48B0-A55C-4A463552264C");
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, "", "", "Avalanche Header Page", "Page Id of header blocks/layout configuration", 0, "", "B2F7130E-1C0C-41F8-A13E-3EE9B77F59B1");

            var siteid = (int)SqlScalar(@" ( SELECT TOP 1 [Id] FROM [Site] WHERE [Guid] = '613631FF-D19C-4F9C-B163-E9331C4BA61B' )");

            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.Page", Rock.SystemGuid.FieldType.TEXT, "SiteId", siteid.ToString(), "Background Color", "Used for KFS Avalanche. Hex or color name for background of page", 0, "#f2f6f8", "1fd61a40-3fe7-4b05-adca-a7edc957921e", "BackgroundColor");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.Page", Rock.SystemGuid.FieldType.SINGLE_SELECT, "SiteId", siteid.ToString(), "Action Type", "Used for KFS Avalanche. Used for tab/page navigation Action Types", 1, "1", "2baa54bb-fe5d-4b1c-bb7a-1b6c1dcb500f", "ActionType");
            RockMigrationHelper.AddAttributeQualifier("2baa54bb-fe5d-4b1c-bb7a-1b6c1dcb500f", "fieldtype", "ddl", "421fda4f-1acc-47db-86fa-1bfd0a7eb903");
            RockMigrationHelper.AddAttributeQualifier("2baa54bb-fe5d-4b1c-bb7a-1b6c1dcb500f", "values", "0^Do Nothing,1^Push New Page,2^Replace CurrentPage,3^Pop CurrentPage,4^Open Browser", "421fda4f-1acc-47db-86fa-1bfd0a7eb903");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.Page", Rock.SystemGuid.FieldType.TEXT, "SiteId", siteid.ToString(), "Resource", "Used for KFS Avalanche. Text string to overwrite resource value in navigation, primarily for 'Open Browser' Action type.", 2, "", "342b2c81-976d-472d-89bf-b8f8f826730e", "Resource");

            // RockMigrationHelper.AddAttributeValue( "1B8B1811-D82F-48B0-A55C-4A463552264C", null, "", "1329FC96-2837-4614-80CB-4C8852C0EAA4" );
            // The AddAttributeValue method doesn't work with a null EntityId, i.e. global attribute values
            Sql(string.Format(@"DECLARE @PageId int = ( SELECT TOP 1 [Id] FROM [Page] WHERE [Guid] = '{0}' )
                DECLARE @AttributeId int
                SET @AttributeId = (SELECT [Id] FROM [Attribute] WHERE [Guid] = '{1}')
                IF NOT EXISTS(Select * FROM [AttributeValue] WHERE [Guid] = '{3}')
                    INSERT INTO [AttributeValue] (
                        [IsSystem],[AttributeId],[EntityId],[Value],[Guid])
                    VALUES(1,@AttributeId,{2},@PageId,'{3}')",
                              "FF495C30-29C5-420C-A35B-E9E808EEBCEF",
                              "1B8B1811-D82F-48B0-A55C-4A463552264C",
                              "null",
                              "1329FC96-2837-4614-80CB-4C8852C0EAA4")
                ); // Add attribute value Footer Page Id
            Sql(string.Format(@"DECLARE @PageId int = ( SELECT TOP 1 [Id] FROM [Page] WHERE [Guid] = '{0}' )
                DECLARE @AttributeId int
                SET @AttributeId = (SELECT [Id] FROM [Attribute] WHERE [Guid] = '{1}')
                IF NOT EXISTS(Select * FROM [AttributeValue] WHERE [Guid] = '{3}' OR AttributeId = @AttributeId)
                    INSERT INTO [AttributeValue] (
                        [IsSystem],[AttributeId],[EntityId],[Value],[Guid])
                    VALUES(1,@AttributeId,{2},@PageId,'{3}')",
                              "567FFD63-53F9-4419-AD96-C2F07CAE09F1",
                              "5FEFE20F-742E-4204-8A1C-7E400F802288",
                              "null",
                              "e45e368e-97bd-4908-b5b3-b0ac6636f688")
                );                                       // Add attribute value Home Page Id
            Sql(@"DECLARE @PageId int = ( SELECT TOP 1 [Id] FROM [Page] WHERE [Guid] = '567FFD63-53F9-4419-AD96-C2F07CAE09F1' )
                UPDATE av SET av.[Value] = @PageId
                FROM [AttributeValue] av
                JOIN Attribute a ON av.AttributeId = a.Id
                WHERE a.[Key] = 'AvalancheHomePage'");   // Set AttributeValue to correct page id
            Sql(@"DECLARE @PageId int = ( SELECT TOP 1 [Id] FROM [Page] WHERE [Guid] = 'FF495C30-29C5-420C-A35B-E9E808EEBCEF' )
                UPDATE av SET av.[Value] = @PageId
                FROM [AttributeValue] av
                JOIN Attribute a ON av.AttributeId = a.Id
                WHERE a.[Key] = 'AvalancheFooterPage'"); // Set AttributeValue to correct page id
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            CreateTable(
                "dbo.SiteUrlMap",
                c => new
            {
                Id                      = c.Int(nullable: false, identity: true),
                SiteId                  = c.Int(nullable: false),
                Token                   = c.String(nullable: false, maxLength: 50),
                Url                     = c.String(nullable: false, maxLength: 200),
                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.Site", t => t.SiteId, cascadeDelete: true)
            .Index(t => t.SiteId)
            .Index(t => t.CreatedByPersonAliasId)
            .Index(t => t.ModifiedByPersonAliasId)
            .Index(t => t.Guid, unique: true);

            AddColumn("dbo.SiteDomain", "Order", c => c.Int(nullable: false));

            // Create a global attribute for default short link site and default to site with lowest default page id (public site)
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.SITE, "", "", "Default Short Link Site", "The default site to use when adding new short links.", 0, "", "DD0E0757-2A01-47BB-A74A-F6E69B0399C8", "DefaultShortLinkSite");
            Sql(@"
    DECLARE @SiteId int = ( SELECT TOP 1 [Id] FROM [Site] ORDER BY [DefaultPageId] )
    UPDATE [Attribute] SET [DefaultValue] = @SiteId WHERE [Guid] = 'DD0E0757-2A01-47BB-A74A-F6E69B0399C8' 
");
            // Add new interaction medium
            RockMigrationHelper.UpdateEntityType("Rock.Model.SiteUrlMap", "C225FE29-F4FA-4A60-996C-56B0F081042E", true, true);
            RockMigrationHelper.UpdateDefinedValue("9BF5777A-961F-49A8-A834-45E5C2077967", "Url Shortner", "Used for tracking views using a short link.", "371066D5-C5F9-4783-88C8-D9AC8DC67468");

            RockMigrationHelper.AddPage("E7BD353C-91A6-4C15-A6C8-F44D0B16D16E", "7CFA101B-2D20-4523-9EC5-3F30502797A5", "Short Link", "", "A9188D7A-80D9-4865-9C77-9F90E992B65C", "");            // Site:Rock RMS
            RockMigrationHelper.AddPage("B4A24AB7-9369-4055-883F-4F4892C39AE3", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Short Links", "", "8C0114FF-31CF-443E-9278-3F9E6087140C", "fa fa-link"); // Site:Rock RMS
            RockMigrationHelper.AddPage("8C0114FF-31CF-443E-9278-3F9E6087140C", "D65F783D-87A9-4CC9-8110-E83466A0EADB", "Link", "", "47D5293B-A041-43A4-915A-FB1D156F265E", "fa fa-link");        // Site:Rock RMS
            RockMigrationHelper.AddPageRoute("A9188D7A-80D9-4865-9C77-9F90E992B65C", "ShortLink/{Page}", "38E68E37-DC86-487A-93A2-8A9F3EBC9768");                                                 // for Page:Short Link

            Sql(@"
    UPDATE [Page] SET [IncludeAdminFooter] = 0 WHERE [Guid] = 'A9188D7A-80D9-4865-9C77-9F90E992B65C'
");
            RockMigrationHelper.UpdateBlockType("Shortened Links", "Displays a dialog for adding a short link to the current page.", "~/Blocks/Administration/ShortLink.ascx", "Administration", "86FB6B0E-E426-4581-96C0-A7654D6A5C7D");
            RockMigrationHelper.UpdateBlockType("Short Link List", "Lists all the short Links .", "~/Blocks/Cms/ShortLinkList.ascx", "CMS", "D6D87CCC-DB6D-4138-A4B5-30F0707A5300");
            RockMigrationHelper.UpdateBlockType("Short Link Detail", "Displays the details for a specific short link.", "~/Blocks/Cms/ShortLinkDetail.ascx", "CMS", "794C564C-6395-4303-812F-3BFBD1057443");
            RockMigrationHelper.UpdateBlockType("Short Link Click List", "Lists cliks for a particular short link.", "~/Blocks/Cms/ShortLinkClickList.ascx", "CMS", "1D7B8095-9E5B-4A9A-A519-69E1746140DD");

            // Add Block to Page: Short Link, Site: Rock RMS
            RockMigrationHelper.AddBlock("A9188D7A-80D9-4865-9C77-9F90E992B65C", "", "86FB6B0E-E426-4581-96C0-A7654D6A5C7D", "Shortened Links", "Main", @"", @"", 0, "B21DFC9B-FB22-4FA1-B7F9-82CE7B4506F1");
            // Add Block to Page: Short Links, Site: Rock RMS
            RockMigrationHelper.AddBlock("8C0114FF-31CF-443E-9278-3F9E6087140C", "", "D6D87CCC-DB6D-4138-A4B5-30F0707A5300", "Short Link List", "Main", @"", @"", 0, "A0ECC10B-BB01-4D5D-BAC2-76192C231A20");
            // Add Block to Page: Link, Site: Rock RMS
            RockMigrationHelper.AddBlock("47D5293B-A041-43A4-915A-FB1D156F265E", "", "794C564C-6395-4303-812F-3BFBD1057443", "Short Link Detail", "Main", @"", @"", 0, "2550B79E-8BBE-4C02-B395-EC1D182EAEA1");
            // Add Block to Page: Link, Site: Rock RMS
            RockMigrationHelper.AddBlock("47D5293B-A041-43A4-915A-FB1D156F265E", "", "1D7B8095-9E5B-4A9A-A519-69E1746140DD", "Short Link Click List", "Main", @"", @"", 1, "7B5CFF37-02CE-4E57-9FEC-C5092D24B6DC");

            // Attrib for BlockType: Shortened Links:Minimum Token Length
            RockMigrationHelper.UpdateBlockTypeAttribute("86FB6B0E-E426-4581-96C0-A7654D6A5C7D", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Minimum Token Length", "MinimumTokenLength", "", "The minimum number of characters for the token.", 0, @"7", "B13D4F65-E00A-4C80-B9E0-A18575985F9B");
            // Attrib for BlockType: Short Link List:Detail Page
            RockMigrationHelper.UpdateBlockTypeAttribute("D6D87CCC-DB6D-4138-A4B5-30F0707A5300", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Detail Page", "DetailPage", "", "", 0, @"", "C857D4CC-3BA0-45FC-B73B-C00D89C8865B");
            // Attrib for BlockType: Short Link Detail:Minimum Token Length
            RockMigrationHelper.UpdateBlockTypeAttribute("794C564C-6395-4303-812F-3BFBD1057443", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Minimum Token Length", "MinimumTokenLength", "", "The minimum number of characters for the token.", 0, @"7", "A8431AE5-78E9-46F0-A355-FDF8204B984E");

            // Attrib Value for Block:Short Link List, Attribute:Detail Page Page: Short Links, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("A0ECC10B-BB01-4D5D-BAC2-76192C231A20", "C857D4CC-3BA0-45FC-B73B-C00D89C8865B", @"47d5293b-a041-43a4-915a-fb1d156f265e");

            // DT: New Failed Payment Email
            Sql(@"
IF EXISTS ( SELECT [Id] FROM [SystemEmail] WHERE [Guid] = '449232B5-9C6B-480E-A881-E317D0BC307E' AND [Body] = '
{{ ''Global'' | Attribute:''EmailHeader'' }}

<p>
    {{ Transaction.AuthorizedPersonAlias.Person.NickName }}, 
</p>
<p>
    We just wanted to make you aware that your gift to {{ ''Global'' | Attribute:''OrganizationName'' }} that was scheduled for {{ Transaction.TransactionDateTime | Date:''M/d/yyyy'' }} in the amount of 
    {{ Transaction.ScheduledTransaction.TotalAmount | FormatAsCurrency }} did not process successfully. If you''d like, you can update your giving profile at 
    <a href=""{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give"">{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give</a>.
</p>

<p>
    Below are the details of your transaction that we were unable to process.
</p>

<p>
<strong>Txn Code:</strong> {{ Transaction.TransactionCode }}<br/>
<strong>Status:</strong> {{ Transaction.Status }}<br/>
<strong>Status Message:</strong> {{ Transaction.StatusMessage }}
</p>

{{ ''Global'' | Attribute:''EmailFooter'' }}
' )
BEGIN
	UPDATE [SystemEmail] SET
		[Subject] = 'Unsuccessful Payment to {{ ''Global'' | Attribute:''OrganizationName'' }}',
		[Body] = '{{ ''Global'' | Attribute:''EmailHeader'' }}

<p>
    {{ Transaction.AuthorizedPersonAlias.Person.NickName }}, 
</p>
<p>
{% if Transaction.ScheduledTransaction %}
    We just wanted to make you aware that your gift to {{ ''Global'' | Attribute:''OrganizationName'' }} that was scheduled for {{ Transaction.TransactionDateTime | Date:''M/d/yyyy'' }} in the amount of 
    {{ Transaction.ScheduledTransaction.TotalAmount | FormatAsCurrency }} did not process successfully. If you''d like, you can update your giving profile at 
    <a href=""{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give"">{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give</a>.
{% else %}
    {% assign amount = Transaction.TotalAmount %}
    {% if amount < 0 %}{% assign amount = 0 | Minus:amount %}{% endif %}
    We just wanted to make you aware that your {{ Transaction.TransactionTypeValue.Value | Downcase }} payment on {{ Transaction.TransactionDateTime | Date:''M/d/yyyy'' }} in the amount of 
    {{ amount | FormatAsCurrency }} did not process successfully. 
    {% if Transaction.TransactionTypeValue.Value == ''Contribution'' %}
        If you''d like, you can re-submit your contribution at  
        <a href=""{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give"">{{ ''Global'' | Attribute:''PublicApplicationRoot'' }}Give</a>.
    {% endif %}
{% endif %}
</p>
<p>
    Below are the details of your transaction that we were unable to process.
</p>

<p>
<strong>Txn Code:</strong> {{ Transaction.TransactionCode }}<br/>
<strong>Status:</strong> {{ Transaction.Status }}<br/>
<strong>Status Message:</strong> {{ Transaction.StatusMessage }}
</p>

{{ ''Global'' | Attribute:''EmailFooter'' }}
'
	WHERE [Guid] = '449232B5-9C6B-480E-A881-E317D0BC307E'
END
");
        }
        /// <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'
");
        }
 public override void Up()
 {
     RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.ENCRYPTED_TEXT, null, null, "EWS Username", "The Microsoft Exchange server username to use with EWS managed API.", 0, null, "EDEEE121-BE8F-4B80-A567-80E8BB344346", "rocks.kfs.EWSUsername", true);
     RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.ENCRYPTED_TEXT, null, null, "EWS Password", "The Microsoft Exchange server password to use with EWS managed API.", 0, null, "0C278C32-C179-4EBE-AF40-F9AD509B8450", "rocks.kfs.EWSPassword", true);
     RockMigrationHelper.AddAttributeQualifier("0C278C32-C179-4EBE-AF40-F9AD509B8450", "ispassword", "true", "08839315-119B-4F39-8EF9-A05B65449392");
 }
Beispiel #20
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            AddColumn("dbo.Location", "Barcode", c => c.String(maxLength: 40));
            AddColumn("dbo.Location", "SoftRoomThreshold", c => c.Int());
            AddColumn("dbo.Location", "FirmRoomThreshold", c => c.Int());

            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "GroupTypePurposeValueId", "", "Check-in Type", "", 0, "1", "90C34D24-7CFB-4A52-B39C-DFF05A40997C", "core_checkin_CheckInType");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "Enable Manager Option", "", 0, "True", "5BF4C3CD-052F-4A21-B677-21811C5ABEDD", "core_checkin_EnableManagerOption");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "Enable Override", "", 0, "True", "745154D6-E108-41C2-9001-7AD543CFC75D", "core_checkin_EnableOverride");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Security Code Length", "", 0, "3", "712CFC8A-7B67-4793-A71E-E2EEB2D1048D", "core_checkin_SecurityCodeLength");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "Reuse Same Code", "", 0, "False", "2B1E044B-6BD7-4F91-86A1-2D854A3BBF2D", "core_checkin_ReuseSameCode");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "One Parent Label", "", 0, "False", "EC7FA927-95D0-44A8-8AB3-2D74A9FA2F26", "core_checkin_OneParentLabel");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "GroupTypePurposeValueId", "", "Search Type", "", 0, "f3f66040-c50f-4d13-9652-780305fffe23", "BBF88ADA-3C2E-4A0B-A9AE-5B07D4557129", "core_checkin_SearchType");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "9C204CD0-1233-41C5-818A-C5DA439445AA", "GroupTypePurposeValueId", "", "Regular Expression Filter", "", 0, "", "DE32D84F-5653-41F9-9B34-D04BA9024670", "core_checkin_RegularExpressionFilter");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Max Search Results", "", 0, "100", "24A8A4B0-F54D-490A-89F6-476B044CD114", "core_checkin_MaxSearchResults");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Minimum Phone Search Length", "", 0, "4", "DA3417AC-7138-4219-9363-7AB37D614350", "core_checkin_MinimumPhoneSearchLength");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Maximum Phone Search Length", "", 0, "10", "93CA081A-6128-4BBE-BF2B-DF55B7AA817C", "core_checkin_MaximumPhoneSearchLength");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "GroupTypePurposeValueId", "", "Phone Search Type", "", 0, "1", "34D0971A-53AB-4D43-94EA-E251081D7F93", "core_checkin_PhoneSearchType");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Refresh Interval", "", 0, "10", "C99D34BF-711B-4865-84B4-B0929C92D16C", "core_checkin_RefreshInterval");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "Age Required", "", 0, "True", "46C8DC94-D57E-4B9A-8FB9-1A797DD3D525", "core_checkin_AgeRequired");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "GroupTypePurposeValueId", "", "Display Location Count", "", 0, "True", "17DA47FF-EC64-4A97-B46B-394626C25100", "core_checkin_DisplayLocationCount");
            RockMigrationHelper.UpdateEntityAttribute("Rock.Model.GroupType", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "GroupTypePurposeValueId", "", "Auto Select Days Back", "", 0, "10", "5BA86237-B327-4A2E-8992-6AE784B2A41C", "core_checkin_AutoSelectDaysBack");

            RockMigrationHelper.UpdateAttributeQualifier("90C34D24-7CFB-4A52-B39C-DFF05A40997C", "fieldtype", "ddl", "6AF5B4B1-8195-4516-B1FE-79705847B8D0");
            RockMigrationHelper.UpdateAttributeQualifier("90C34D24-7CFB-4A52-B39C-DFF05A40997C", "values", "0^Individual,1^Family", "1594AB67-5C71-44C6-ABEA-397741193C13");
            RockMigrationHelper.UpdateAttributeQualifier("5BF4C3CD-052F-4A21-B677-21811C5ABEDD", "falsetext", "No", "2B6CC1F3-7406-4E98-81A1-6A8E1D5498BC");
            RockMigrationHelper.UpdateAttributeQualifier("5BF4C3CD-052F-4A21-B677-21811C5ABEDD", "truetext", "Yes", "DD7C6C2F-5A9A-463E-93CA-F2D586FD66D9");
            RockMigrationHelper.UpdateAttributeQualifier("745154D6-E108-41C2-9001-7AD543CFC75D", "falsetext", "No", "4550571C-FBEC-4AAA-B4FB-DE46A026D339");
            RockMigrationHelper.UpdateAttributeQualifier("745154D6-E108-41C2-9001-7AD543CFC75D", "truetext", "Yes", "79C7E1F1-2E72-49F9-8997-C0843B991FBC");
            RockMigrationHelper.UpdateAttributeQualifier("2B1E044B-6BD7-4F91-86A1-2D854A3BBF2D", "falsetext", "No", "82E9F4E5-46CB-4CDF-960D-5A51E8CB45B7");
            RockMigrationHelper.UpdateAttributeQualifier("2B1E044B-6BD7-4F91-86A1-2D854A3BBF2D", "truetext", "Yes", "7FCE46BD-9A5D-4690-8C18-35F1944847F5");
            RockMigrationHelper.UpdateAttributeQualifier("EC7FA927-95D0-44A8-8AB3-2D74A9FA2F26", "falsetext", "No", "2E70DFC8-8060-4434-A9A3-5296A6B93DBF");
            RockMigrationHelper.UpdateAttributeQualifier("EC7FA927-95D0-44A8-8AB3-2D74A9FA2F26", "truetext", "Yes", "06829171-7914-4586-B9B7-561F7BE4CF25");
            RockMigrationHelper.UpdateAttributeQualifier("BBF88ADA-3C2E-4A0B-A9AE-5B07D4557129", "allowmultiple", "False", "47685D73-D7FD-47E7-B1AE-7CB288EBA68D");
            RockMigrationHelper.UpdateAttributeQualifier("BBF88ADA-3C2E-4A0B-A9AE-5B07D4557129", "definedtype", "20", "504A6A25-40D1-4D6C-AECD-F27445DEA07D");
            RockMigrationHelper.UpdateAttributeQualifier("BBF88ADA-3C2E-4A0B-A9AE-5B07D4557129", "displaydescription", "False", "130B1BA3-BD02-4298-B313-CC98549D0414");
            RockMigrationHelper.UpdateAttributeQualifier("DE32D84F-5653-41F9-9B34-D04BA9024670", "ispassword", "False", "0431ED1A-73A3-4BC9-8E41-C394EA92B69B");
            RockMigrationHelper.UpdateAttributeQualifier("34D0971A-53AB-4D43-94EA-E251081D7F93", "fieldtype", "ddl", "B38CF989-BAAD-4636-BFD0-6C620E764591");
            RockMigrationHelper.UpdateAttributeQualifier("34D0971A-53AB-4D43-94EA-E251081D7F93", "values", "0^Contains,1^Ends With", "1A60F90C-5ADE-454E-9FDE-741E9F879840");
            RockMigrationHelper.UpdateAttributeQualifier("46C8DC94-D57E-4B9A-8FB9-1A797DD3D525", "falsetext", "No", "8F5FF24C-21B6-49A2-B7CF-C1D014CA8102");
            RockMigrationHelper.UpdateAttributeQualifier("46C8DC94-D57E-4B9A-8FB9-1A797DD3D525", "truetext", "Yes", "22B1DADA-835D-45A8-99DE-315FF277122F");
            RockMigrationHelper.UpdateAttributeQualifier("17DA47FF-EC64-4A97-B46B-394626C25100", "falsetext", "No", "183E12A4-6123-4955-88F5-7696D8398410");
            RockMigrationHelper.UpdateAttributeQualifier("17DA47FF-EC64-4A97-B46B-394626C25100", "truetext", "Yes", "CE99805D-AAA1-440A-B0AF-DBF22E77CC49");

            Sql(MigrationSQL._201604251529438_CheckinEnhancement);

            // Remove old page/blocks
            RockMigrationHelper.DeleteBlock("883CE93C-2AF9-443B-9531-B8E5277D3CEA");
            RockMigrationHelper.DeleteBlock("5F2EA21F-CB8A-4A6B-9E33-A3D8570DC716");
            RockMigrationHelper.DeletePage("4AB679AF-C8CC-427C-A615-0BF9F52E8E3E");

            RockMigrationHelper.UpdateBlockType("Check-in Type Detail", "Displays the details of a particular Check-in Type.", "~/Blocks/CheckIn/Config/CheckinTypeDetail.ascx", "Check-in > Configuration", "6CB1416A-3B25-41FD-8E60-1B94F4A64AE6");
            RockMigrationHelper.UpdateBlockType("Check-in Types", "Displays the check-in types.", "~/Blocks/CheckIn/Config/CheckinTypes.ascx", "Check-in > Configuration", "50029382-75A6-4B73-9644-880845B3116A");
            RockMigrationHelper.UpdateBlockType("Check-in Areas", "Configure Check-in areas and groups.", "~/Blocks/CheckIn/Config/CheckinAreas.ascx", "Check-in > Configuration", "B7CD296F-3AAB-4BA3-902C-44DB96C79798");

            // Add Block to Page: Check-in Configuration, Site: Rock RMS
            RockMigrationHelper.AddBlock("C646A95A-D12D-4A67-9BE6-C9695C0267ED", "", "50029382-75A6-4B73-9644-880845B3116A", "Check-in Types", "Main", "", "", 0, "72578C6C-3970-4AE7-A528-AFC761EA578A");
            // Add Block to Page: Check-in Type, Site: Rock RMS
            RockMigrationHelper.AddBlock("C646A95A-D12D-4A67-9BE6-C9695C0267ED", "", "6CB1416A-3B25-41FD-8E60-1B94F4A64AE6", "Check-in Type Detail", "Main", "", "", 0, "71C3B7F8-E35B-498A-B03E-3C547794C881");
            // Add Block to Page: Check-in Type, Site: Rock RMS
            RockMigrationHelper.AddBlock("C646A95A-D12D-4A67-9BE6-C9695C0267ED", "", "B7CD296F-3AAB-4BA3-902C-44DB96C79798", "Check-in Areas", "Main", "", "", 1, "DB03DADC-36D8-4135-B339-DCE1A02772A8");

            // Attrib for BlockType: Check-in Type Detail:Schedule Page
            RockMigrationHelper.AddBlockTypeAttribute("6CB1416A-3B25-41FD-8E60-1B94F4A64AE6", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Schedule Page", "SchedulePage", "", "Page used to manage schedules for the check-in type.", 0, @"", "2819D6CE-C8BF-4E7A-88DF-7F1E4E322AFC");
            // Attrib Value for Block:Check-in Type Detail, Attribute:Schedule Page Page: Check-in Type, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("71C3B7F8-E35B-498A-B03E-3C547794C881", "2819D6CE-C8BF-4E7A-88DF-7F1E4E322AFC", @"a286d16b-fddf-4d89-b98f-d51188b611e6");

            // Migration Rollups
            Sql(MigrationSQL._201604251529438_UpdateLegacyLava);

            // add new global attribute to determine Lava Support Level
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.SINGLE_SELECT, "", "", "Lava Support Level",
                                                   @"Legacy - Old Lava syntax will still be supported without any warnings
LegacyWithWarning - Old Lava syntax will be supported, but a warning will be logged to the exceptions log to help identify lava that needs to be updated
NoLegacy - Old Lava syntax will be ignored and not loaded. (Best Performance)",
                                                   0, "Legacy", "C8E30F2B-7476-4B02-86D4-3E5057F03FD5", "core.LavaSupportLevel");

            Sql(@"  
    DECLARE @LavaSupportLevelAttributeId int = (SELECT TOP 1 [Id] FROM [Attribute] WHERE [Guid] = 'C8E30F2B-7476-4B02-86D4-3E5057F03FD5')
    INSERT INTO [AttributeQualifier] 
     ([IsSystem], [AttributeId], [Key], [Value], [Guid])
     VALUES
      (0, @LavaSupportLevelAttributeId, 'fieldtype', 'ddl', newid())
    INSERT INTO [AttributeQualifier] 
     ([IsSystem], [AttributeId], [Key], [Value], [Guid])
     VALUES
      (0, @LavaSupportLevelAttributeId, 'values', 'Legacy, LegacyWithWarning, NoLegacy', newid())
");
        }
Beispiel #21
0
 public override void Up()
 {
     RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.KEY_VALUE_LIST, "", "", "Avalanche Attributes", "Attributes to send to Avalanche to change it's behaviour.", 0, "", "C4FE37BA-1504-4D45-974A-06E472CE2780");
 }
Beispiel #22
0
 /// <summary>
 /// Operations to be performed during the upgrade process.
 /// </summary>
 public override void Up()
 {
     RockMigrationHelper.AddGlobalAttribute("1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "", "", "Enable Route Domain Matching", "When enabled, the domain in the request must match the page's site domain; otherwise the site's 404 page will be used. If set to No, a route outside the page's site domain can match (if one inside the site was not found).", 0, @"True", "0B7DD63E-AD00-445E-8E9D-047956FEAFB3", "core_EnableRouteDomainMatching");
 }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // add universal search job
            Sql(@"IF NOT EXISTS(SELECT [Id] FROM [ServiceJob] WHERE [Class] = 'Rock.Jobs.IndexEntities')
BEGIN
	INSERT INTO [ServiceJob] (
         [IsSystem]
        ,[IsActive]
        ,[Name]
        ,[Description]
        ,[Class]
        ,[CronExpression]
        ,[NotificationStatus]
        ,[Guid] )
    VALUES (
         0
        ,0
        ,'Universal Search Re-Index'
        ,'Reindexes entities for universal search.'
        ,'Rock.Jobs.IndexEntities'
        ,'0 0 5 1/1 * ? *'
        ,1
        ,'D4B9EFE0-18D4-37AE-4C58-F757E9E2F121');
END");

            // Respect Campus Context in GroupContextSetter.ascx
            RockMigrationHelper.AddBlockTypeAttribute("62F749F7-67DF-4A84-B7DD-84CA8E10E205",
                                                      "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Respect Campus Context", "RespectCampusContext", "",
                                                      "Filter groups by the Campus Context block if it exists", 6, @"False",
                                                      "525A2D95-7ACC-4129-9805-DCA4E45A7C63");

            // core.PersonPickerFetchCount
            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.INTEGER, null, null, "Person Picker Fetch Count", "The maximum number of people to include in a person picker search result", 0, "60", "4515337B-309A-43DE-B4AE-3E19338CE5B2", "core.PersonPickerFetchCount");

            // Hide Business TransactionLinks when Editing
            RockMigrationHelper.UpdateBlockTypeAttribute("19B61D65-37E3-459F-A44F-DEF0089118A3", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Is Secondary Block", "IsSecondaryBlock", "", "Flag indicating whether this block is considered secondary and should be hidden when other secondary blocks are hidden.", 12, @"False", "04C15DC1-DFB6-4D63-A7BC-0507D0E33EF4");
            // Attrib Value for Block:Transaction Links, Attribute:Is Secondary Block Page: Business Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("84F800D3-C32E-4A16-9F84-081F8CB4DCBF", "04C15DC1-DFB6-4D63-A7BC-0507D0E33EF4", @"True");

            Sql(@"Update [Block] set PreHtml = '<div class=''col-md-4''>
<div class=""panel panel-block js-hide-nocontent""><div class=""panel-body"">', PostHtml='<script>
    $(document).ready(function(){
        Sys.Application.add_load(function(){
            // find the js-hide-nocontent node from the pre-Html
            var $hideNoContent = $(''.js-hide-nocontent'');
            
            // if it has an HtmlContentBlock on it, but it hasn''t rendered anything, hide the panel panel-block divs
            var $htmlContent = $hideNoContent.find(''.html-content-view'');
            if (!$htmlContent.html()) {
                $hideNoContent.hide();
            } else {
                $hideNoContent.show();
            }
        });
    });
    
</script>' where [Guid] = '84F800D3-C32E-4A16-9F84-081F8CB4DCBF'");

            // Update to universal search template
            Sql(@"UPDATE [EntityType]
  SET [IndexResultTemplate] = '{% if IndexDocument.IndexModelType == ""Rock.UniversalSearch.IndexModels.PersonIndex"" %}

    {% assign url = ""~/Person/"" | ResolveRockUrl %}
    
    {% if DisplayOptions.Person-Url and DisplayOptions.Person-Url != null and DisplayOptions.Person-Url != '''' %}
        {% assign url = DisplayOptions.Person-Url | ResolveRockUrl %}
    {% endif %}
    
    
    <div class=""row model-cannavigate"" data-href=""{{ url }}{{ IndexDocument.Id }}"">
        <div class=""col-sm-1 text-center"">
            <div class=""photo-round photo-round-sm"" style=""margin: 0 auto;"" data-original=""{{ IndexDocument.PhotoUrl |  ResolveRockUrl }}&maxwidth=200&maxheight=200&w=100 }}"" style=""background-image: url({{ ""~/Assets/Images/person-no-photo-male.svg"" |  ResolveRockUrl }}); display: block;""></div>
        </div>
        <div class=""col-md-3 col-sm-10"">
            <strong>{{ IndexDocument.NickName}} {{ IndexDocument.LastName}} {{ IndexDocument.Suffix }}</strong> 
            <br>
            {% if IndexDocument.Email != null and IndexDocument.Email != '''' %}
                {{ IndexDocument.Email }} <br>
            {% endif %}
    
            {% if IndexDocument.StreetAddress != '' and IndexDocument.StreetAddress != null %}
                {{ IndexDocument.StreetAddress }}<br>
            {% endif %}
            
            {% if IndexDocument.City != '' and IndexDocument.City != null %}
                {{ IndexDocument.City }}, {{ IndexDocument.State }} {{ IndexDocument.PostalCode }}
            {% endif %}
        </div>
        <div class=""col-md-2"">
            Connection Status: <br> 
            {{ IndexDocument.ConnectionStatusValueId | FromCache:''DefinedValue'' | Property:''Value'' }}
        </div>
        <div class=""col-md-2"">
            Age: <br> 
            {{ IndexDocument.Age }}
        </div>
        <div class=""col-md-2"">
            Record Status: <br> 
            {{ IndexDocument.RecordStatusValueId | FromCache:''DefinedValue'' | Property:''Value'' }}
        </div>
        <div class=""col-md-2"">
            Campus: <br> 
            {{ IndexDocument.CampusId | FromCache:''Campus'' | Property:''Name'' }}
        </div>
    </div>

{% elseif IndexDocument.IndexModelType == ""Rock.UniversalSearch.IndexModels.BusinessIndex"" %}
    {% assign url = ""~/Business/"" | ResolveRockUrl %}
    
    {% if DisplayOptions.Business-Url and DisplayOptions.Business-Url != null and DisplayOptions.Business-Url != '''' %}
        {% assign url = DisplayOptions.Business-Url | ResolveRockUrl %}
    {% endif %}
    
    
    <div class=""row model-cannavigate"" data-href=""{{ url }}{{ IndexDocument.Id }}"">
        <div class=""col-sm-1 text-center"">
            <i class=""{{ IndexDocument.IconCssClass }} fa-2x""></i>
        </div>
        <div class=""col-sm-11"">
            <strong>{{ IndexDocument.Name}}</strong> 

            {% if IndexDocument.Contacts != null and IndexDocument.Contacts != '''' %}
                <br>Contacts: {{ IndexDocument.Contacts }}
            {% endif %}
        </div>
    </div>
{% endif %}'
  WHERE [Name] = 'Rock.Model.Person'");

            // Add new 'EditFinancials' security
            Sql(@"DECLARE @EntityTypeId INT = ( SELECT TOP 1 [Id] FROM [EntityType] WHERE [Name] = 'Rock.Model.Block' )
DECLARE @PersonEditBlockId INT = ( SELECT TOP 1 [Id] FROM [Block] WHERE [Guid] = '59C7EA79-2073-4EA9-B439-7E74F06E8F5B' )

IF NOT EXISTS ( 
	SELECT * 
	FROM [Auth] 
	WHERE [EntityTypeId] = @EntityTypeId 
	AND [EntityId] = @PersonEditBlockId
	AND [Action] = 'EditFinancials' )
BEGIN

	DECLARE @Order INT = 0

	DECLARE @FinanceWorkerGroupId INT = ( SELECT TOP 1 [Id] FROM [Group] WHERE [Guid] = '2539CF5D-E2CE-4706-8BBF-4A9DF8E763E9' )
	IF @FinanceWorkerGroupId IS NOT NULL
	BEGIN
		INSERT INTO [dbo].[Auth] ( [EntityTypeId],[EntityId],[Order],[Action],[AllowOrDeny],[SpecialRole],[GroupId],[Guid])
		VALUES ( @EntityTypeId, @PersonEditBlockId, @Order, 'EditFinancials', 'A', 0, @FinanceWorkerGroupId, NEWID() )
	END

	DECLARE @FinanceAdminGroupId INT = ( SELECT TOP 1 [Id] FROM [Group] WHERE [Guid] = '6246A7EF-B7A3-4C8C-B1E4-3FF114B84559' )
	IF @FinanceAdminGroupId IS NOT NULL
	BEGIN
		INSERT INTO [dbo].[Auth] ( [EntityTypeId],[EntityId],[Order],[Action],[AllowOrDeny],[SpecialRole],[GroupId],[Guid])
		VALUES ( @EntityTypeId, @PersonEditBlockId, @Order, 'EditFinancials', 'A', 0, @FinanceAdminGroupId, NEWID() )
	END

	DECLARE @RockAdminGroupId INT = ( SELECT TOP 1 [Id] FROM [Group] WHERE [Guid] = '628C51A8-4613-43ED-A18D-4A6FB999273E' )
	IF @RockAdminGroupId IS NOT NULL
	BEGIN
		INSERT INTO [dbo].[Auth] ( [EntityTypeId],[EntityId],[Order],[Action],[AllowOrDeny],[SpecialRole],[GroupId],[Guid])
		VALUES ( @EntityTypeId, @PersonEditBlockId, @Order, 'EditFinancials', 'A', 0, @RockAdminGroupId, NEWID() )
	END

	INSERT INTO [dbo].[Auth] ( [EntityTypeId],[EntityId],[Order],[Action],[AllowOrDeny],[SpecialRole],[Guid])
	VALUES ( @EntityTypeId, @PersonEditBlockId, @Order, 'EditFinancials', '@', 1, NEWID() )

END");

            // Add Active Registration Instances
            RockMigrationHelper.UpdateBlockType("Registration Instance Active List", "Block to display active Registration Instances.", "~/Blocks/Event/RegistrationInstanceActiveList.ascx", "Event", "CFE8CAFA-587B-4EF2-A457-18047AC6BA39");
            RockMigrationHelper.AddBlock("614AF351-6C48-4B6B-B50E-9F7E03BC00A4", "", "CFE8CAFA-587B-4EF2-A457-18047AC6BA39", "Registration Instance Active List", "Main", "", "", 3, "682AC7FB-84ED-4F6F-866C-60C3A2E92AAE");
        }
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            CreateTable(
                "dbo.PersonToken",
                c => new
            {
                Id               = c.Int(nullable: false, identity: true),
                PersonAliasId    = c.Int(nullable: false),
                Token            = c.String(maxLength: 32),
                ExpireDateTime   = c.DateTime(),
                TimesUsed        = c.Int(nullable: false),
                UsageLimit       = c.Int(),
                LastUsedDateTime = c.DateTime(),
                PageId           = c.Int(),
                Guid             = c.Guid(nullable: false),
                ForeignId        = c.Int(),
                ForeignGuid      = c.Guid(),
                ForeignKey       = c.String(maxLength: 100),
            })
            .PrimaryKey(t => t.Id)
            .ForeignKey("dbo.Page", t => t.PageId, cascadeDelete: true)
            .ForeignKey("dbo.PersonAlias", t => t.PersonAliasId, cascadeDelete: true)
            .Index(t => t.PersonAliasId)
            .Index(t => t.Token, unique: true)
            .Index(t => t.PageId)
            .Index(t => t.Guid, unique: true);

            // Add global attributes for Person Tokens
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.BOOLEAN, "", "", "Person Token Use Legacy Fallback", @"Use the pre-v7 person token lookup if the impersonation token can't be found using the v7 person tokens.", 0, true.ToString(), "8063EAE0-5FFC-4113-8F7B-A45CC0BE3B63", "core.PersonTokenUseLegacyFallback");
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.INTEGER, "", "", "Person Token Expire Minutes", @"The default number of minutes a person token is valid after it is issued.", 0, (30 * 24 * 60).ToString(), "D4EDDB65-5861-442B-8109-A4EBBE9A961F", "core.PersonTokenExpireMinutes");
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.INTEGER, "", "", "Person Token Usage Limit", @"The default maximum number of times a person token can be used.", 0, "", "28D921E5-045F-49BE-A8F3-C8FA60331D45", "core.PersonTokenUsageLimit");

            // Assign 'Config' category to the Person Token Global attributes
            Sql(@"
  DECLARE @ConfigCategoryId int = (SELECT TOP 1 [Id] FROM [Category] WHERE [Guid] = 'BB40B563-18D1-4133-94B9-D7F67D95E4E3')
  INSERT INTO [AttributeCategory] ([AttributeId], [CategoryId]) select Id, @ConfigCategoryId from [Attribute] where [Guid] in ('8063EAE0-5FFC-4113-8F7B-A45CC0BE3B63', 'D4EDDB65-5861-442B-8109-A4EBBE9A961F', '28D921E5-045F-49BE-A8F3-C8FA60331D45');
  ");

            // register new Person Transaction Links block type
            RockMigrationHelper.UpdateBlockType("Person Transaction Links", "Block for displaying links to add and schedule transactions for a person.", "~/Blocks/Crm/PersonDetail/TransactionLinks.ascx", "CRM > Person Detail", "2BB707AC-F29A-44DF-A103-7454077509B4");

            // Attrib for BlockType: Person Transaction Links:Person Token Usage Limit
            RockMigrationHelper.UpdateBlockTypeAttribute("2BB707AC-F29A-44DF-A103-7454077509B4", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Person Token Usage Limit", "PersonTokenUsageLimit", "", "The maximum number of times the person token for the transaction can be used.", 3, @"1", "0B458C5E-A15F-4C05-9926-7A298C377D63");

            // Attrib for BlockType: Person Transaction Links:Is Secondary Block
            RockMigrationHelper.UpdateBlockTypeAttribute("2BB707AC-F29A-44DF-A103-7454077509B4", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Is Secondary Block", "IsSecondaryBlock", "", "Flag indicating whether this block is considered secondary and should be hidden when other secondary blocks are hidden.", 1, @"False", "53F61E84-CABF-44D0-AFC4-FCC777B9F3BE");

            // Attrib for BlockType: Person Transaction Links:Person Token Expire Minutes
            RockMigrationHelper.UpdateBlockTypeAttribute("2BB707AC-F29A-44DF-A103-7454077509B4", "A75DFC58-7A1B-4799-BF31-451B2BBE38FF", "Person Token Expire Minutes", "PersonTokenExpireMinutes", "", "The number of minutes the person token for the transaction is valid after it is issued.", 2, @"60", "D2B1BD60-04F1-4809-AA19-75581B29341D");

            // Attrib for BlockType: Person Transaction Links:Add Transaction Page
            RockMigrationHelper.UpdateBlockTypeAttribute("2BB707AC-F29A-44DF-A103-7454077509B4", "BD53F9C9-EBA9-4D3F-82EA-DE5DD34A8108", "Add Transaction Page", "AddTransactionPage", "", "", 0, @"B1CA86DC-9890-4D26-8EBD-488044E1B3DD", "A37EF84F-95AF-45E5-A6CC-0C8E591F80DB");


            /* Update Transaction Links HTML blocks to use TranactionLinks block instead */
            // delete old Transaction Links HTML block from Person Contributions tab
            RockMigrationHelper.DeleteBlock("6F7F97D3-6C7D-4B58-A6E7-9A21BF55428A");

            // Add Block to Page: Person | Contributions, Site: Rock RMS
            RockMigrationHelper.AddBlock(true, "53CF4CBE-85F9-4A50-87D7-0D72A3FB2892", "", "2BB707AC-F29A-44DF-A103-7454077509B4", "Person Transaction Links", "SectionA2", @"<div class=""panel panel-block""><div class=""panel-body"">", @"", 0, "013ACB2A-48AD-4325-9566-6A6B821C8C21");

            // delete old Transaction Links HTML block from Business Detail
            RockMigrationHelper.DeleteBlock("84F800D3-C32E-4A16-9F84-081F8CB4DCBF");

            // Add Block to Page: Business Detail, Site: Rock RMS
            RockMigrationHelper.AddBlock(true, "D2B43273-C64F-4F57-9AAE-9571E1982BAC", "", "2BB707AC-F29A-44DF-A103-7454077509B4", "Transaction Links", "Main", @"<div class='col-md-4'>
<div class=""panel panel-block js-hide-nocontent""><div class=""panel-body"">", @"", 2, "4A7394DA-4E92-4E15-B75E-0C79E691A9B2");

            // Attrib Value for Block:Transaction Links, Attribute:Is Secondary Block Page: Business Detail, Site: Rock RMS
            RockMigrationHelper.AddBlockAttributeValue("4A7394DA-4E92-4E15-B75E-0C79E691A9B2", "53F61E84-CABF-44D0-AFC4-FCC777B9F3BE", @"True");
        }
Beispiel #25
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            AddColumn("dbo.GroupTypeRole", "CanManageMembers", c => c.Boolean(nullable: false));

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT,
                                                   string.Empty, string.Empty,
                                                   "Google ReCaptcha Site Key", "The Secret Key provided by the Google ReCaptcha admin console.",
                                                   0, string.Empty, SystemGuid.Attribute.GLOBAL_GOOGLE_RECAPTCHA_SITE_KEY, "core_GoogleReCaptchaSiteKey");

            RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT,
                                                   string.Empty, string.Empty,
                                                   "Google ReCaptcha Secret Key", "The Secret Key provided by the Google ReCaptcha admin console.",
                                                   0, string.Empty, SystemGuid.Attribute.GLOBAL_GOOGLE_RECAPTCHA_SECRET_KEY, "core_GoogleReCaptchaSecretKey");

            RockMigrationHelper.AddPage(true, "7625A63E-6650-4886-B605-53C2234FA5E1", "325B7BFD-8B80-44FD-A951-4E4763DA6C0D", "Family Pre-Registration", "", "3B31B9A2-DE35-4407-8E7D-3633F93906CD", ""); // Site:External Website
            RockMigrationHelper.AddPageRoute("3B31B9A2-DE35-4407-8E7D-3633F93906CD", "FamilyPreRegistration", "E518B93B-26AB-42A8-989A-6A2DA864EF25");                                                    // for Page:Family Pre-Registration

            RockMigrationHelper.AddPage(true, "3B31B9A2-DE35-4407-8E7D-3633F93906CD", "325B7BFD-8B80-44FD-A951-4E4763DA6C0D", "Famiy Pre-Registration", "", "B37D22BE-D2A8-4EFA-8B2B-2E0EFF6EDB44", "");  // Site:External Website
            RockMigrationHelper.AddPageRoute("B37D22BE-D2A8-4EFA-8B2B-2E0EFF6EDB44", "FamilyPreRegistrationSuccess", "7C47D437-E576-48EE-B308-FDD81C4F9386");                                             // for Page:Family Pre-Registration Success
            Sql(@"
    UPDATE [Page] SET [BreadCrumbDisplayName] = 0 WHERE [Guid] = 'B37D22BE-D2A8-4EFA-8B2B-2E0EFF6EDB44'
");
            RockMigrationHelper.UpdateBlockType("Family Pre-Registration", "Provides a way to allow people to pre-register their families for weekend check-in.", "~/Blocks/Crm/FamilyPreRegistration.ascx", "Check-in", "463A454A-6370-4B4A-BCA1-415F2D9B0CB7");

            // Add Block to Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlock(true, "3B31B9A2-DE35-4407-8E7D-3633F93906CD", "", "CACB9D1A-A820-4587-986A-D66A69EE9948", "Page Menu", "Sidebar1", @"", @"", 0, "A2388785-4FCD-4FBC-9EAF-F007FA7ADA99");
            // Add Block to Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlock(true, "3B31B9A2-DE35-4407-8E7D-3633F93906CD", "", "463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "Family Pre-Registration", "Main", @"", @"", 0, "4EB7A683-F28D-4708-BF7E-BC9A80FA1A06");
            // Add Block to Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlock(true, "B37D22BE-D2A8-4EFA-8B2B-2E0EFF6EDB44", "", "19B61D65-37E3-459F-A44F-DEF0089118A3", "HTML Content", "Main", @"", @"", 0, "DC006503-C69E-49CC-B384-EB199AFED5BD");
            // Add Block to Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlock(true, "B37D22BE-D2A8-4EFA-8B2B-2E0EFF6EDB44", "", "CACB9D1A-A820-4587-986A-D66A69EE9948", "Page Menu", "Sidebar1", @"", @"", 0, "91742CE0-FC1B-4E1B-B046-24748DD5F6CC");

            // Add/Update HtmlContent for Block: HTML Content
            RockMigrationHelper.UpdateHtmlContentBlock("DC006503-C69E-49CC-B384-EB199AFED5BD", @"{% assign when = PageParameter.When %}
<h2>Thank-you for Registering!</h2>
<h4>We're excited to see you on {{ when | Date:'dddd' }}!</h4>
<br/><br/>
<h4>Now What?</h4>
<p>When you arrive, just head to the Children's Ministry Check-in Desk to check-in your children.</p>
<p>If you have any questions when you are trying to check in children, please see a volunteer to help you.</p>
<p>You will receive a tag to place on each child, as well as a tag for you to use to pick up your children after the service.</p>
<p>Then, just take your children to the room listed on their tag.</p>
<p>When the service is over, return to the same room where you dropped off your children and present your other tag to check them out.</p>", "D99BFE10-72A8-4349-A838-860EC34516D8");

            // Attrib for BlockType: Family Pre-Registration:Known Relationship Types
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "BD0D9B57-2A41-4490-89FF-F01DAB7D4904", "Known Relationship Types", "Relationships", "", @"The known relationship types that should be displayed as the possible ways that a child can be related to the adult(s).", 0, @"0", "B0126571-2A6E-42AF-8206-EA7E1AA6E2E6");
            // Attrib for BlockType: Family Pre-Registration:Same Family Known Relationship Types
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "BD0D9B57-2A41-4490-89FF-F01DAB7D4904", "Same Family Known Relationship Types", "FamilyRelationships", "", @"The known relationship types that if selected for a child should just add child to same family as the adult(s) rather than actually creating the know relationship.", 1, @"0", "75379DB6-11B2-4948-AF56-85589BE569AD");
            // Attrib for BlockType: Family Pre-Registration:Can Check-in Known Relationship Types
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "BD0D9B57-2A41-4490-89FF-F01DAB7D4904", "Can Check-in Known Relationship Types", "CanCheckinRelationships", "", @"The known relationship types that if selected for a child should also create the 'Can Check-in' known relationship type.", 2, @"", "C095F851-D713-4666-B437-D28AD8547A8D");
            // Attrib for BlockType: Family Pre-Registration:Show Campus
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Show Campus", "ShowCampus", "", @"Should the campus field be displayed?", 0, @"True", "D1E84153-89DA-49F1-8C3B-A1071225978B");
            // Attrib for BlockType: Family Pre-Registration:Auto Match
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Auto Match", "AutoMatch", "", @"Should this block attempt to match people to to current records in the database.", 5, @"True", "F7CFEAAE-C295-4B84-941E-72054F0AD1F7");
            // Attrib for BlockType: Family Pre-Registration:Allow Updates
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1EDAFDED-DFE6-4334-B019-6EECBA89E05A", "Allow Updates", "AllowUpdates", "", @"If the person visiting this block is logged in, should the block be used to update their family? If not, a new family will always be created unless 'Auto Match' is enabled and the information entered matches an existing person.", 4, @"False", "E5AD4FFE-CF89-4768-A43D-C8B8200F14C2");
            // Attrib for BlockType: Family Pre-Registration:Workflow Types
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1D50399B-0D6E-480B-A71A-E7BD37DD83F0", "Workflow Types", "WorkflowTypes", "", @"
The workflow type(s) to launch when a family is added. The primary family will be passed to each workflow as the entity. Additionally if the workflow type has any of the following attribute keys defined, those attribute values will also be set: ParentIds, ChildIds, PlannedVisitDate.
", 8, @"", "A94136DB-8BAD-4B19-9D21-686B75FFEB92");
            // Attrib for BlockType: Family Pre-Registration:Family Attributes
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "99B090AA-4D7E-46D8-B393-BF945EA1BA8B", "Family Attributes", "FamilyAttributes", "", @"The Family attributes that should be displayed", 3, @"", "2CD19B7E-0831-40AC-A05D-4E690079B11A");
            // Attrib for BlockType: Family Pre-Registration:Suffix
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Suffix", "ChildSuffix", "", @"How should Suffix be displayed for children?", 0, @"Hide", "54E5EE57-3133-42E1-A6E6-1B1781A7FF30");
            // Attrib for BlockType: Family Pre-Registration:Birth Date
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Birth Date", "AdultBirthdate", "", @"How should Gender be displayed for adults?", 2, @"Optional", "1BA9D9FD-B3B7-4121-8541-1E2736250C1B");
            // Attrib for BlockType: Family Pre-Registration:Planned Visit Date
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Planned Visit Date", "PlannedVisitDate", "", @"How should the Planned Visit Date field be displayed (this value is only used when starting a workflow)?", 2, @"Optional", "09FDE848-1D37-4E56-88A7-26CEE91ED9B0");
            // Attrib for BlockType: Family Pre-Registration:Suffix
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Suffix", "AdultSuffix", "", @"How should Suffix be displayed for adults?", 0, @"Hide", "90F96BB4-BC83-4290-96A8-95074646736F");
            // Attrib for BlockType: Family Pre-Registration:Gender
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Gender", "AdultGender", "", @"How should Gender be displayed for adults?", 1, @"Optional", "2F57914E-0EC9-478D-9012-A1F349444C95");
            // Attrib for BlockType: Family Pre-Registration:Email
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Email", "AdultEmail", "", @"How should Email be displayed for adults?", 4, @"Required", "9B4B62FC-0BC3-416B-A506-5A1693F06287");
            // Attrib for BlockType: Family Pre-Registration:Mobile Phone
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Mobile Phone", "AdultMobilePhone", "", @"How should Mobile Phone be displayed for adults?", 5, @"Required", "6E943B74-F141-4F1E-AE31-B9DC5CA5DF62");
            // Attrib for BlockType: Family Pre-Registration:Gender
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Gender", "ChildGender", "", @"How should Gender be displayed for children?", 1, @"Optional", "66F6BE0D-5440-42F8-BB3D-41FEAEC81632");
            // Attrib for BlockType: Family Pre-Registration:Birth Date
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Birth Date", "ChildBirthdate", "", @"How should Gender be displayed for children?", 2, @"Required", "DC4861D2-6A8A-4466-8772-C07E59D5BD8E");
            // Attrib for BlockType: Family Pre-Registration:Grade
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Grade", "ChildGrade", "", @"How should Grade be displayed for children?", 3, @"Optional", "DACFD270-F239-440C-8906-4E01A3B60863");
            // Attrib for BlockType: Family Pre-Registration:Mobile Phone
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Mobile Phone", "ChildMobilePhone", "", @"How should Mobile Phone be displayed for children?", 4, @"Hide", "30CC4D33-EB07-4A24-A95D-F81882FE621F");
            // Attrib for BlockType: Family Pre-Registration:Marital Status
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "7525C4CB-EE6B-41D4-9B64-A08048D5A5C0", "Marital Status", "AdultMaritalStatus", "", @"How should Marital Status be displayed for adults?", 3, @"Required", "2CD1A897-651E-45DA-8CB4-7D7F0DF73B2A");
            // Attrib for BlockType: Family Pre-Registration:Connection Status
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "Connection Status", "ConnectionStatus", "", @"The connection status that should be used when adding new people.", 6, @"B91BA046-BC1E-400C-B85D-638C1F4E0CE2", "8F372CAB-AC31-4074-AD82-756333FD7778");
            // Attrib for BlockType: Family Pre-Registration:Record Status
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "59D5A94C-94A0-4630-B80A-BB25697D74C7", "Record Status", "RecordStatus", "", @"The record status that should be used when adding new people.", 7, @"618F906C-C33D-4FA3-8AEF-E58CB7B63F1E", "EFF3D9C6-C467-4969-AC28-A26EEB8E28B8");
            // Attrib for BlockType: Family Pre-Registration:Default Campus
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1B71FEF4-201F-4D53-8C60-2DF21F1985ED", "Default Campus", "DefaultCampus", "", @"An optional campus to use by default when adding a new family.", 1, @"", "092A9700-DCDA-4BB1-9FAD-5C6089E77E1D");
            // Attrib for BlockType: Family Pre-Registration:Attribute Categories
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "775899FB-AC17-4C2C-B809-CF3A1D2AA4E1", "Attribute Categories", "AdultAttributeCategories", "", @"The adult Attribute Categories to display attributes from", 6, @"", "BB6E36A5-4B44-4B55-9980-995E3D4B2024");
            // Attrib for BlockType: Family Pre-Registration:Attribute Categories
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "775899FB-AC17-4C2C-B809-CF3A1D2AA4E1", "Attribute Categories", "ChildAttributeCategories", "", @"The children Attribute Categories to display attributes from.", 5, @"", "2A65C2FF-686D-4FA6-B7B8-D364657F150C");
            // Attrib for BlockType: Family Pre-Registration:Redirect URL
            RockMigrationHelper.UpdateBlockTypeAttribute("463A454A-6370-4B4A-BCA1-415F2D9B0CB7", "1D0D3794-C210-48A8-8C68-3FBEC08A6BA5", "Redirect URL", "RedirectURL", "", @"
The URL to redirect user to when they have completed the registration. The merge fields that are available includes 'Family', which is an object for the primary family 
that is created/updated, and 'RelatedChildren', which is a list of the children who have a relationship with the family, but are not in the family.
", 9, @"", "579F1F5E-1393-4476-895D-FED8CC2343CA");

            // Attrib Value for Block:Page Menu, Attribute:Include Current Parameters Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "EEE71DDE-C6BC-489B-BAA5-1753E322F183", @"False");
            // Attrib Value for Block:Page Menu, Attribute:Template Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "1322186A-862A-4CF1-B349-28ECB67229BA", @"{% include '~~/Assets/Lava/PageSubNav.lava' %}");
            // Attrib Value for Block:Page Menu, Attribute:Root Page Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "41F1C42E-2395-4063-BD4F-031DF8D5B231", @"7625a63e-6650-4886-b605-53c2234fa5e1");
            // Attrib Value for Block:Page Menu, Attribute:Number of Levels Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "6C952052-BC79-41BA-8B88-AB8EA3E99648", @"1");
            // Attrib Value for Block:Page Menu, Attribute:CSS File Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "7A2010F0-0C0C-4CC5-A29B-9CBAE4DE3A22", @"");
            // Attrib Value for Block:Page Menu, Attribute:Include Current QueryString Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "E4CF237D-1D12-4C93-AFD7-78EB296C4B69", @"False");
            // Attrib Value for Block:Page Menu, Attribute:Is Secondary Block Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "C80209A8-D9E0-4877-A8E3-1F7DBF64D4C2", @"False");
            // Attrib Value for Block:Page Menu, Attribute:Include Page List Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("A2388785-4FCD-4FBC-9EAF-F007FA7ADA99", "0A49DABE-42EE-40E5-9E06-0E6530944865", @"");

            // Attrib Value for Block:Family Pre-Registration, Attribute:Suffix Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "54E5EE57-3133-42E1-A6E6-1B1781A7FF30", @"Hide");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Birth Date Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "1BA9D9FD-B3B7-4121-8541-1E2736250C1B", @"Optional");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Show Campus Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "D1E84153-89DA-49F1-8C3B-A1071225978B", @"True");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Default Campus Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "092A9700-DCDA-4BB1-9FAD-5C6089E77E1D", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Planned Visit Date Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "09FDE848-1D37-4E56-88A7-26CEE91ED9B0", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Family Attributes Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "2CD19B7E-0831-40AC-A05D-4E690079B11A", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Auto Match Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "F7CFEAAE-C295-4B84-941E-72054F0AD1F7", @"True");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Connection Status Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "8F372CAB-AC31-4074-AD82-756333FD7778", @"b91ba046-bc1e-400c-b85d-638c1f4e0ce2");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Record Status Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "EFF3D9C6-C467-4969-AC28-A26EEB8E28B8", @"618f906c-c33d-4fa3-8aef-e58cb7b63f1e");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Suffix Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "90F96BB4-BC83-4290-96A8-95074646736F", @"Hide");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Gender Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "2F57914E-0EC9-478D-9012-A1F349444C95", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Email Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "9B4B62FC-0BC3-416B-A506-5A1693F06287", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Mobile Phone Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "6E943B74-F141-4F1E-AE31-B9DC5CA5DF62", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Attribute Categories Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "BB6E36A5-4B44-4B55-9980-995E3D4B2024", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Gender Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "66F6BE0D-5440-42F8-BB3D-41FEAEC81632", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Birth Date Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "DC4861D2-6A8A-4466-8772-C07E59D5BD8E", @"Required");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Grade Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "DACFD270-F239-440C-8906-4E01A3B60863", @"Optional");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Mobile Phone Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "30CC4D33-EB07-4A24-A95D-F81882FE621F", @"Hide");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Attribute Categories Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "2A65C2FF-686D-4FA6-B7B8-D364657F150C", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Known Relationship Types Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "B0126571-2A6E-42AF-8206-EA7E1AA6E2E6", @"0");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Same Family Known Relationship Types Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "75379DB6-11B2-4948-AF56-85589BE569AD", @"0");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Can Check-in Known Relationship Types Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "C095F851-D713-4666-B437-D28AD8547A8D", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Workflow Types Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "A94136DB-8BAD-4B19-9D21-686B75FFEB92", @"");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Redirect URL Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "579F1F5E-1393-4476-895D-FED8CC2343CA", @"~/FamilyPreRegistrationSuccess?FamilyId={{ Family.Id }}&Parents={{ ParentIds }}&Children={{ ChildIds }}&When={{ PlannedVisitDate }}");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Allow Updates Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "E5AD4FFE-CF89-4768-A43D-C8B8200F14C2", @"False");
            // Attrib Value for Block:Family Pre-Registration, Attribute:Marital Status Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("4EB7A683-F28D-4708-BF7E-BC9A80FA1A06", "2CD1A897-651E-45DA-8CB4-7D7F0DF73B2A", @"Optional");

            // Attrib Value for Block:Page Menu, Attribute:Include Page List Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "0A49DABE-42EE-40E5-9E06-0E6530944865", @"");
            // Attrib Value for Block:Page Menu, Attribute:Is Secondary Block Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "C80209A8-D9E0-4877-A8E3-1F7DBF64D4C2", @"False");
            // Attrib Value for Block:Page Menu, Attribute:CSS File Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "7A2010F0-0C0C-4CC5-A29B-9CBAE4DE3A22", @"");
            // Attrib Value for Block:Page Menu, Attribute:Include Current Parameters Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "EEE71DDE-C6BC-489B-BAA5-1753E322F183", @"False");
            // Attrib Value for Block:Page Menu, Attribute:Number of Levels Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "6C952052-BC79-41BA-8B88-AB8EA3E99648", @"1");
            // Attrib Value for Block:Page Menu, Attribute:Include Current QueryString Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "E4CF237D-1D12-4C93-AFD7-78EB296C4B69", @"False");
            // Attrib Value for Block:Page Menu, Attribute:Template Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "1322186A-862A-4CF1-B349-28ECB67229BA", @"{% include '~~/Assets/Lava/PageSubNav.lava' %}");
            // Attrib Value for Block:Page Menu, Attribute:Root Page Page: Family Pre-Registration, Site: External Website
            RockMigrationHelper.AddBlockAttributeValue("91742CE0-FC1B-4E1B-B046-24748DD5F6CC", "41F1C42E-2395-4063-BD4F-031DF8D5B231", @"7625a63e-6650-4886-b605-53c2234fa5e1");
        }
 /// <summary>
 /// Operations to be performed during the upgrade process.
 /// </summary>
 public override void Up()
 {
     RockMigrationHelper.AddGlobalAttribute("73B02051-0D38-4AD9-BF81-A2D477DE4F70", "", "", "Email Exceptions Filter", "Before sending the exception notification email, Rock can evaluate the current client's HTTP Server variables and ignore any exceptions from clients that have server variable values containing the values configured here.", 0, "HTTP_USER_AGENT^Googlebot|", "120E6F4C-030E-4FA8-B1B1-119FAC77CC2C");
 }
Beispiel #27
0
 /// <summary>
 /// MP: Adds the API maximum items per page global attribute.
 /// </summary>
 private void AddExportAPIsMaxItemsPerPageGlobalAttribute()
 {
     RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.INTEGER, null, null, "Export APIs Max Items Per Page", "The maximum number of items that can be returned when a page of data is requested thru the REST Export APIs.", 0, "1000", "F80A2DDC-88D0-40BB-8376-1A6323B44886", "core_ExportAPIsMaxItemsPerPage");
 }
 /// <summary>
 /// The commands to run to migrate plugin to the specific version
 /// </summary>
 public override void Up()
 {
     RockMigrationHelper.UpdatePersonAttributeCategory("Finance Internal", "fa fa-money", "Internal Finance Attributes", SystemGuid.Category.PERSON_ATTRIBUTES_FINANCE_INTERNAL);
     RockMigrationHelper.UpdatePersonAttribute(SystemGuid.FieldType.INTEGER, SystemGuid.Category.PERSON_ATTRIBUTES_FINANCE_INTERNAL, "Envelope Number", "core_GivingEnvelopeNumber", "fa fa-money", "The Giving Envelope Number that is associated with this Person", 1, "", SystemGuid.Attribute.PERSON_GIVING_ENVELOPE_NUMBER);
     RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.BOOLEAN, null, null, "Enable Giving Envelope Number", "Enables the Giving Envelope Number feature", 0, false.ToString(), Rock.SystemGuid.Attribute.GLOBAL_ENABLE_GIVING_ENVELOPE, "core.EnableGivingEnvelopeNumber");
 }
 /// <summary>
 /// The commands to run to migrate plugin to the specific version
 /// </summary>
 public override void Up()
 {
     RockMigrationHelper.AddGlobalAttribute(Rock.SystemGuid.FieldType.TEXT, null, null, "GroupMe API Token", "You can find this on https://dev.groupme.com/applications", 0, string.Empty, SystemGuid.GlobalAttribute.GROUPME_API_TOKEN, SystemKey.GlobalAttribute.GROUPME_API_TOKEN);
 }
Beispiel #30
0
        /// <summary>
        /// Operations to be performed during the upgrade process.
        /// </summary>
        public override void Up()
        {
            // Add a Safe To Send To attribute to the Safe Sender domains.
            Sql(@"
    UPDATE [DefinedType] SET [Description] = 'Safe Sender Domains are the domains that can be used to safely send outgoing emails.  
If an email communication is created with a From Address that is not from one of these domains, Rock will change the From Address 
to the Organization Email global attribute value instead, and the original From Address will be used as the Reply To address.
Rock will not change the from address if the email is from one of these safe domains, OR if all the recipients of the email belong 
to one of these domains that has the ''Safe To Send To'' flag enabled. This is to help reduce the likelihood of communications 
being rejected by the receiving email servers due to the email having a different sending domain than the server sending the email.'
    WHERE [Guid] = 'DB91D0E9-DCA6-45A9-8276-AEF032BE8AED'
");
            RockMigrationHelper.AddDefinedTypeAttribute("DB91D0E9-DCA6-45A9-8276-AEF032BE8AED", Rock.SystemGuid.FieldType.BOOLEAN, "Safe To Send To", "SafeToSendTo", "Domains that are safe to send to without changing the From address.", 0, "false", "409486D1-33AF-4F4E-9721-626CF731CFAA");
            Sql("Update [Attribute] set [IsGridColumn] = 1 where [Guid] = '409486D1-33AF-4F4E-9721-626CF731CFAA' ");

            // MP: Add Index to InteractionComponent
            Sql(@"
    IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'IX_EntityId_ChannelId' AND object_id = OBJECT_ID('InteractionComponent'))
    BEGIN
        CREATE INDEX [IX_EntityId_ChannelId] ON [dbo].[InteractionComponent] ([EntityId],[ChannelId])
    END
");

            // MP: Tuneup ETL Stored Procs
            Sql(MigrationSQL._201709131136468_spAnalytics_ETL_Attendance);
            Sql(MigrationSQL._201709131136468_spAnalytics_ETL_FinancialTransaction);

            // MP: Add AnalyticsSourceAttendance Index
            Sql(@"
    IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'IX_AttendanceType_CurrentPerson_StartDateTime' AND object_id = OBJECT_ID('AnalyticsSourceAttendance'))
    BEGIN
        CREATE INDEX [IX_AttendanceType_CurrentPerson_StartDateTime] ON [dbo].[AnalyticsSourceAttendance] ([AttendanceTypeId],[CurrentPersonKey],[StartDateTime])
    END
");

            // MP: Update Communication InteractionChannel
            Sql(@"
    DECLARE @DefinedValueChannelTypeCommunication INT = (
        SELECT TOP 1 Id
        FROM DefinedValue
        WHERE [Guid] = '55004F5C-A8ED-7CB7-47EE-5988E9F8E0A8'
    )
    ,@InteractionChannel_COMMUNICATION UNIQUEIDENTIFIER = 'C88A187F-0343-4E7C-AF3F-79A8989DFA65'

    UPDATE InteractionChannel SET ChannelTypeMediumValueId = @DefinedValueChannelTypeCommunication
    WHERE ChannelTypeMediumValueId IS NULL
    AND [Guid] = @InteractionChannel_COMMUNICATION
");

            // DT: Set default Communication Preference
            Sql(@"
    UPDATE [Person] SET [CommunicationPreference] = 1	-- Email
");

            // JE: Update Universal Search Boost Global Attribute

            // update global attribute for boosting universal search models (this method deletes the existing value then adds)
            RockMigrationHelper.AddGlobalAttribute(SystemGuid.FieldType.KEY_VALUE_LIST, "", "", "Universal Search Index Boost", "Allows you to boost certain universal search indexes.", 1000, "", "757F912F-55E0-76A9-46D2-345BB61D7B02", "UniversalSearchIndexBoost");

            // 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");

            // MP: Mask Account Number
            Sql(@"
    DECLARE @CCType INT = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '928A2E04-C77B-4282-888F-EC549CEE026A' )

    DECLARE @Visa INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = 'FC66B5F8-634F-4800-A60D-436964D27B64' )
    DECLARE @MasterCard INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '6373A4B6-4DCA-4EB6-9ADE-B30E8A7F8621' )
    DECLARE @Amex INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '696A54E3-352C-49FB-88A1-BCDBD81AA9EC' )
    DECLARE @Discover INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '4B746601-E9EB-4660-BA13-C0B66B24E248' )
    DECLARE @Diners INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '1A9A4DB9-AFF3-4773-875C-C10346BD1CA7' )
    DECLARE @JCB INT  = ( SELECT TOP 1 [Id] FROM [DefinedValue] WHERE GUID = '4DD7F0C2-F6B7-4510-90E6-287ADC25FD05' )

    ;WITH CTE AS (
	    SELECT 
		    [Id],
		    CASE 
			    WHEN [AccountNumberMasked] LIKE '34%' AND LEN([AccountNumberMasked]) = 15 THEN @Amex
			    WHEN [AccountNumberMasked] LIKE '37%' AND LEN([AccountNumberMasked]) = 15 THEN @Amex

			    WHEN [AccountNumberMasked] LIKE '300%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '301%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '302%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '303%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '304%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '305%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners
			    WHEN [AccountNumberMasked] LIKE '36%' AND LEN([AccountNumberMasked]) = 14 THEN @Diners

			    WHEN [AccountNumberMasked] LIKE '6011%' AND LEN([AccountNumberMasked]) = 16 THEN @Discover

			    WHEN [AccountNumberMasked] LIKE '3%' AND LEN([AccountNumberMasked]) = 16 THEN @JCB
			    WHEN [AccountNumberMasked] LIKE '1800%' AND LEN([AccountNumberMasked]) = 15 THEN @JCB
			    WHEN [AccountNumberMasked] LIKE '2131%' AND LEN([AccountNumberMasked]) = 15 THEN @JCB

			    WHEN [AccountNumberMasked] LIKE '51%' AND LEN([AccountNumberMasked]) = 16 THEN @MasterCard
			    WHEN [AccountNumberMasked] LIKE '52%' AND LEN([AccountNumberMasked]) = 16 THEN @MasterCard
			    WHEN [AccountNumberMasked] LIKE '53%' AND LEN([AccountNumberMasked]) = 16 THEN @MasterCard
			    WHEN [AccountNumberMasked] LIKE '54%' AND LEN([AccountNumberMasked]) = 16 THEN @MasterCard
			    WHEN [AccountNumberMasked] LIKE '55%' AND LEN([AccountNumberMasked]) = 16 THEN @MasterCard

			    WHEN [AccountNumberMasked] LIKE '4%' AND LEN([AccountNumberMasked]) = 13 THEN @Visa
			    WHEN [AccountNumberMasked] LIKE '4%' AND LEN([AccountNumberMasked]) = 16 THEN @Visa

		    END AS [CCType]	

	    FROM [FinancialPaymentDetail]
	    WHERE [CurrencyTypeValueId] = @CCType
	    AND [CreditCardTypeValueId] IS NULL
	    AND [AccountNumberMasked] IS NOT NULL
	    AND [AccountNumberMasked] NOT LIKE '*%'
    )

    UPDATE P SET [CreditCardTypeValueId] = DV.[Id]
    FROM CTE
    INNER JOIN [FinancialPaymentDetail] P ON P.[Id] = CTE.[Id]
    INNER JOIN [DefinedValue] DV ON DV.[Id] = CTE.[CCType]

    UPDATE FinancialPaymentDetail SET AccountNumberMasked = REPLICATE('*', len(AccountNumberMasked) - 4) + Right(AccountNumberMasked, 4)
    WHERE AccountNumberMasked IS NOT NULL
    AND REPLICATE('*', len(AccountNumberMasked) - 4) + Right(AccountNumberMasked, 4) != AccountNumberMasked

    UPDATE FinancialPersonBankAccount SET AccountNumberMasked = REPLICATE('*', len(AccountNumberMasked) - 4) + Right(AccountNumberMasked, 4)
    WHERE AccountNumberMasked IS NOT NULL
    AND REPLICATE('*', len(AccountNumberMasked) - 4) + Right(AccountNumberMasked, 4) != AccountNumberMasked
");

            // MP: Add BinaryFileType "Communication Image"
            Sql(@"
    DECLARE @StorageEntityTypeFileSystemId INT = (
        SELECT Id
        FROM EntityType
        WHERE [Guid] = 'A97B6002-454E-4890-B529-B99F8F2F376A'
        )

    IF NOT EXISTS (
        SELECT Id
        FROM BinaryFileType
        WHERE [Guid] = '60B896C3-F00C-411C-A31C-2D5D4CCBB65F'
    )
    BEGIN
        INSERT INTO [dbo].[BinaryFileType] (
            [IsSystem]
            ,[Name]
            ,[Description]
            ,[IconCssClass]
            ,[StorageEntityTypeId]
            ,[AllowCaching]
            ,[Guid]
            ,[RequiresViewSecurity]
        )
        VALUES (
             1
            ,'Communication Image'
            ,'Image used for Communications'
            ,'fa fa-comment-o'
            ,@StorageEntityTypeFileSystemId
            ,1
            ,'60B896C3-F00C-411C-A31C-2D5D4CCBB65F'
            ,0
        );
    END
    ELSE
    BEGIN
        UPDATE [dbo].[BinaryFileType]
        SET 
             [Name] = 'Communication Image'
            ,[IsSystem] = 1
            ,[Description] = 'Image used for Communications'
            ,[IconCssClass] = 'fa fa-comment-o'
            ,[StorageEntityTypeId] = @StorageEntityTypeFileSystemId
            ,[AllowCaching] = 1
            ,[RequiresViewSecurity] = 0
        WHERE [Guid] = '60B896C3-F00C-411C-A31C-2D5D4CCBB65F'
    END
");
        }