C# Class Rock.Migrations.RockMigration4

Custom Migration methods
Inheritance: DbMigration
Mostra file Open project: NewSpring/Rock

Public Methods

Method Description
AddAttributeValue ( string attributeGuid, int entityId, string value, string guid ) : void

Adds a new attribute value for the given attributeGuid if it does not already exist.

AddBlock ( string pageGuid, string layoutGuid, string blockTypeGuid, string name, string zone, string preHtml, string postHtml, int order, string guid ) : void

Adds a new Block of the given block type to the given page (optional) and layout (optional), setting its values with the given parameter values. If only the layout is given, edit/configuration authorization will also be inserted into the Auth table for the admin role (GroupId 2).

AddBlockAttributeValue ( string blockGuid, string attributeGuid, string value ) : void

Adds a new block attribute value for the given block guid and attribute guid, deleting any previously existing attribute value first.

AddBlockType ( string name, string description, string path, string category, string guid ) : void

Adds a new BlockType.

AddBlockTypeAttribute ( string blockTypeGuid, string fieldTypeGuid, string name, string key, string category, string description, int order, string defaultValue, string guid ) : void

Adds a new BlockType Attribute for the given blocktype and key.

AddDefinedType ( string category, string name, string description, string guid ) : void

Adds a new DefinedType.

AddDefinedValue ( string definedTypeGuid, string name, string description, string guid, bool isSystem = true ) : void

Adds a new DefinedValue for the given DefinedType.

AddEntityAttribute ( string entityTypeName, string fieldTypeGuid, string entityTypeQualifierColumn, string entityTypeQualifierValue, string name, string category, string description, int order, string defaultValue, string guid ) : void

Adds a new EntityType Attribute for the given EntityType, FieldType, and name (key).

AddGlobalAttribute ( string fieldTypeGuid, string entityTypeQualifierColumn, string entityTypeQualifierValue, string name, string description, int order, string defaultValue, string guid ) : void

Adds a global Attribute for the given FieldType, entityTypeQualifierColumn, entityTypeQualifierValue and name (key). Note: This method delets the Attribute first if it had already existed.

AddGroupTypeGroupAttribute ( string groupTypeGuid, string fieldTypeGuid, string name, string description, int order, string defaultValue, string guid ) : void

Adds a new GroupType "Group Attribute" for the given GroupType using the given values.

AddLayout ( string siteGuid, string fileName, string name, string description, string guid ) : void

Adds a new Layout to the given site.

AddPage ( string parentPageGuid, string layoutGuid, string name, string description, string guid, string iconCssClass = "" ) : void

Adds a new Page to the given parent page. The new page will be ordered as last child of the parent page.

AddPageContext ( string pageGuid, string entity, string idParameter ) : void

Adds a new PageContext to the given page.

AddPageRoute ( string pageGuid, string route ) : void

Adds a new PageRoute to the given page but only if the given route name does not exist.

AddPersonBadgeAttribute ( string personBadgeGuid, string fieldTypeGuid, string name, string key, string description, int order, string defaultValue, string guid ) : void

Adds (or Deletes and Adds) the person badge attribute.

AddPersonBadgeAttributeValue ( string personBadgeGuid, string attributeGuid, string value ) : void

Adds/Updates the person badge attribute value.

AddSecurityAuth ( string entityTypeName, string action, string groupGuid, string authGuid ) : void

Adds the security auth record for the given entity type and group.

AddSecurityAuthForBinaryFileType ( string binaryFileTypeGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void

Adds the binaryfiletype security authentication. Set GroupGuid to null when setting to a special role

AddSecurityAuthForBlock ( string blockGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void

Adds the page security authentication. Set GroupGuid to null when setting to a special role

AddSecurityAuthForGroupType ( string groupTypeGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void

Adds the page security authentication. Set GroupGuid to null when setting to a special role

AddSecurityAuthForPage ( string pageGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void

Adds the page security authentication. Set GroupGuid to null when setting to a special role

AddSecurityRoleGroup ( string name, string description, string guid ) : void

Adds the security role group.

DeleteAttribute ( string guid ) : void

Deletes the attribute.

DeleteBlock ( string guid ) : void

Deletes the block and any authorization records that belonged to it.

DeleteBlockAttribute ( string guid ) : void

Deletes the block Attribute.

DeleteBlockAttributeValue ( string blockGuid, string attributeGuid ) : void

Deletes the block attribute value.

DeleteBlockType ( string guid ) : void

Deletes the BlockType.

DeleteCategory ( string guid ) : void

Deletes the category.

DeleteDefinedType ( string guid ) : void

Deletes the DefinedType.

DeleteDefinedValue ( string guid ) : void

Deletes the DefinedValue.

DeleteEntityType ( string guid ) : void

Deletes the EntityType.

DeleteFieldType ( string guid ) : void

Deletes the FieldType.

DeleteLayout ( string guid ) : void

Deletes the Layout.

DeletePage ( string guid ) : void

Deletes the Page and any PageViews that use the page.

DeleteSecurityAuth ( string guid ) : void

Deletes the security auth record.

DeleteSecurityAuthForBlock ( string blockGuid ) : void

Deletes the security authentication for block.

DeleteSecurityAuthForGroupType ( string groupTypeGuid ) : void

Deletes the security authentication for groupType.

DeleteSecurityAuthForPage ( string pageGuid ) : void

Deletes the security authentication for page.

DeleteSecurityRoleGroup ( string guid ) : void

Deletes the security role group.

MovePage ( string pageGuid, string parentPageGuid ) : void

Moves the Page to the new given parent page.

UpdateBlockType ( string name, string description, string path, string category, string guid ) : void

Updates the BlockType by path (if it exists); otherwise it inserts a new record. In either case it will be marked IsSystem.

UpdateBlockTypeAttribute ( string blockTypeGuid, string fieldTypeGuid, string name, string key, string category, string description, int order, string defaultValue, string guid ) : void

Updates the BlockType Attribute for the given blocktype and key (if it exists); otherwise it inserts a new record.

UpdateCategory ( string entityTypeGuid, string name, string iconCssClass, string description, string guid ) : void

Updates the category.

UpdateDefinedValue ( string definedTypeGuid, string name, string description, string guid, bool isSystem = true ) : void

Updates (or Adds) the defined value for the given DefinedType.

UpdateEntityType ( string name, string guid, bool isEntity, bool isSecured ) : void

Updates the EntityType by name (if it exists); otherwise it inserts a new record.

UpdateEntityType ( string name, string friendlyName, string assemblyName, bool isEntity, bool isSecured, string guid ) : void

Updates the EntityType by name (if it exists); otherwise it inserts a new record.

UpdateEntityTypeMultiValueFieldType ( string entityTypeName, string fieldTypeGuid ) : void

Updates the EntityType MultiValueFieldType

UpdateEntityTypeSingleValueFieldType ( string entityTypeName, string fieldTypeGuid ) : void

Updates the EntityType SingleValueFieldType

UpdateFieldType ( string name, string description, string assembly, string className, string guid, bool IsSystem = true ) : void

Updates the FieldType by assembly and className (if it exists); otherwise it inserts a new record.

UpdatePersonAttribute ( string fieldTypeGuid, string categoryGuid, string name, string key, string iconCssClass, string description, int order, string defaultValue, string guid ) : void

Updates the BlockType Attribute for the given blocktype and key (if it exists); otherwise it inserts a new record.

UpdatePersonBadge ( string name, string description, string entityTypeName, int order, string guid ) : void

Updates the PersonBadge by Guid (if it exists); otherwise it inserts a new record.

Private Methods

Method Description
EnsureEntityTypeExists ( string entityTypeName ) : void

Ensures the entity type exists by adding it by name if it did not already exist.

Method Details

AddAttributeValue() public method

Adds a new attribute value for the given attributeGuid if it does not already exist.
public AddAttributeValue ( string attributeGuid, int entityId, string value, string guid ) : void
attributeGuid string The attribute GUID.
entityId int The entity id.
value string The value.
guid string The GUID.
return void

AddBlock() public method

Adds a new Block of the given block type to the given page (optional) and layout (optional), setting its values with the given parameter values. If only the layout is given, edit/configuration authorization will also be inserted into the Auth table for the admin role (GroupId 2).
public AddBlock ( string pageGuid, string layoutGuid, string blockTypeGuid, string name, string zone, string preHtml, string postHtml, int order, string guid ) : void
pageGuid string The page GUID.
layoutGuid string The layout GUID.
blockTypeGuid string The block type GUID.
name string The name.
zone string The zone.
preHtml string The pre HTML.
postHtml string The post HTML.
order int
guid string
return void

AddBlockAttributeValue() public method

Adds a new block attribute value for the given block guid and attribute guid, deleting any previously existing attribute value first.
public AddBlockAttributeValue ( string blockGuid, string attributeGuid, string value ) : void
blockGuid string The block GUID.
attributeGuid string The attribute GUID.
value string The value.
return void

AddBlockType() public method

Adds a new BlockType.
public AddBlockType ( string name, string description, string path, string category, string guid ) : void
name string
description string
path string
category string
guid string
return void

AddBlockTypeAttribute() public method

Adds a new BlockType Attribute for the given blocktype and key.
public AddBlockTypeAttribute ( string blockTypeGuid, string fieldTypeGuid, string name, string key, string category, string description, int order, string defaultValue, string guid ) : void
blockTypeGuid string The block GUID.
fieldTypeGuid string The field type GUID.
name string The name.
key string The key.
category string The category.
description string The description.
order int The order.
defaultValue string The default value.
guid string The GUID.
return void

AddDefinedType() public method

Adds a new DefinedType.
public AddDefinedType ( string category, string name, string description, string guid ) : void
category string The category.
name string The name.
description string The description.
guid string The GUID.
return void

AddDefinedValue() public method

Adds a new DefinedValue for the given DefinedType.
public AddDefinedValue ( string definedTypeGuid, string name, string description, string guid, bool isSystem = true ) : void
definedTypeGuid string The defined type GUID.
name string The name.
description string The description.
guid string The GUID.
isSystem bool if set to true [is system].
return void

AddEntityAttribute() public method

Adds a new EntityType Attribute for the given EntityType, FieldType, and name (key).
public AddEntityAttribute ( string entityTypeName, string fieldTypeGuid, string entityTypeQualifierColumn, string entityTypeQualifierValue, string name, string category, string description, int order, string defaultValue, string guid ) : void
entityTypeName string Name of the entity type.
fieldTypeGuid string The field type GUID.
entityTypeQualifierColumn string The entity type qualifier column.
entityTypeQualifierValue string The entity type qualifier value.
name string The name.
category string The category.
description string The description.
order int The order.
defaultValue string The default value.
guid string The GUID.
return void

AddGlobalAttribute() public method

Adds a global Attribute for the given FieldType, entityTypeQualifierColumn, entityTypeQualifierValue and name (key). Note: This method delets the Attribute first if it had already existed.
public AddGlobalAttribute ( string fieldTypeGuid, string entityTypeQualifierColumn, string entityTypeQualifierValue, string name, string description, int order, string defaultValue, string guid ) : void
fieldTypeGuid string The field type GUID.
entityTypeQualifierColumn string The entity type qualifier column.
entityTypeQualifierValue string The entity type qualifier value.
name string The name.
description string The description.
order int The order.
defaultValue string The default value.
guid string The GUID.
return void

AddGroupTypeGroupAttribute() public method

Adds a new GroupType "Group Attribute" for the given GroupType using the given values.
public AddGroupTypeGroupAttribute ( string groupTypeGuid, string fieldTypeGuid, string name, string description, int order, string defaultValue, string guid ) : void
groupTypeGuid string
fieldTypeGuid string
name string
description string
order int
defaultValue string a string, empty string, or NULL
guid string
return void

AddLayout() public method

Adds a new Layout to the given site.
public AddLayout ( string siteGuid, string fileName, string name, string description, string guid ) : void
siteGuid string The site GUID.
fileName string Name of the file.
name string The name.
description string The description.
guid string The GUID.
return void

AddPage() public method

Adds a new Page to the given parent page. The new page will be ordered as last child of the parent page.
public AddPage ( string parentPageGuid, string layoutGuid, string name, string description, string guid, string iconCssClass = "" ) : void
parentPageGuid string The parent page GUID.
layoutGuid string The layout GUID.
name string The name.
description string The description.
guid string The GUID.
iconCssClass string The icon CSS class.
return void

AddPageContext() public method

Adds a new PageContext to the given page.
public AddPageContext ( string pageGuid, string entity, string idParameter ) : void
pageGuid string The page GUID.
entity string The entity.
idParameter string The id parameter.
return void

AddPageRoute() public method

Adds a new PageRoute to the given page but only if the given route name does not exist.
public AddPageRoute ( string pageGuid, string route ) : void
pageGuid string The page GUID.
route string The route.
return void

AddPersonBadgeAttribute() public method

Adds (or Deletes and Adds) the person badge attribute.
public AddPersonBadgeAttribute ( string personBadgeGuid, string fieldTypeGuid, string name, string key, string description, int order, string defaultValue, string guid ) : void
personBadgeGuid string The person badge unique identifier.
fieldTypeGuid string The field type unique identifier.
name string The name.
key string The key.
description string The description.
order int The order.
defaultValue string The default value.
guid string The unique identifier.
return void

AddPersonBadgeAttributeValue() public method

Adds/Updates the person badge attribute value.
public AddPersonBadgeAttributeValue ( string personBadgeGuid, string attributeGuid, string value ) : void
personBadgeGuid string The person badge unique identifier.
attributeGuid string The attribute unique identifier.
value string The value.
return void

AddSecurityAuth() public method

Adds the security auth record for the given entity type and group.
public AddSecurityAuth ( string entityTypeName, string action, string groupGuid, string authGuid ) : void
entityTypeName string Name of the entity type.
action string The action.
groupGuid string The group GUID.
authGuid string The auth GUID.
return void

AddSecurityAuthForBinaryFileType() public method

Adds the binaryfiletype security authentication. Set GroupGuid to null when setting to a special role
public AddSecurityAuthForBinaryFileType ( string binaryFileTypeGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void
binaryFileTypeGuid string The binary file type unique identifier.
order int The order.
action string The action.
allow bool if set to true [allow].
groupGuid string The group unique identifier.
specialRole Rock The special role.
authGuid string The authentication unique identifier.
return void

AddSecurityAuthForBlock() public method

Adds the page security authentication. Set GroupGuid to null when setting to a special role
public AddSecurityAuthForBlock ( string blockGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void
blockGuid string
order int
action string The action.
allow bool
groupGuid string The group unique identifier.
specialRole Rock The special role.
authGuid string The authentication unique identifier.
return void

AddSecurityAuthForGroupType() public method

Adds the page security authentication. Set GroupGuid to null when setting to a special role
public AddSecurityAuthForGroupType ( string groupTypeGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void
groupTypeGuid string
order int
action string The action.
allow bool
groupGuid string The group unique identifier.
specialRole Rock The special role.
authGuid string The authentication unique identifier.
return void

AddSecurityAuthForPage() public method

Adds the page security authentication. Set GroupGuid to null when setting to a special role
public AddSecurityAuthForPage ( string pageGuid, int order, string action, bool allow, string groupGuid, Rock specialRole, string authGuid ) : void
pageGuid string The page unique identifier.
order int
action string The action.
allow bool
groupGuid string The group unique identifier.
specialRole Rock The special role.
authGuid string The authentication unique identifier.
return void

AddSecurityRoleGroup() public method

Adds the security role group.
public AddSecurityRoleGroup ( string name, string description, string guid ) : void
name string The name.
description string The description.
guid string The GUID.
return void

DeleteAttribute() public method

Deletes the attribute.
public DeleteAttribute ( string guid ) : void
guid string The GUID.
return void

DeleteBlock() public method

Deletes the block and any authorization records that belonged to it.
public DeleteBlock ( string guid ) : void
guid string The GUID.
return void

DeleteBlockAttribute() public method

Deletes the block Attribute.
public DeleteBlockAttribute ( string guid ) : void
guid string The GUID.
return void

DeleteBlockAttributeValue() public method

Deletes the block attribute value.
public DeleteBlockAttributeValue ( string blockGuid, string attributeGuid ) : void
blockGuid string The block GUID.
attributeGuid string The attribute GUID.
return void

DeleteBlockType() public method

Deletes the BlockType.
public DeleteBlockType ( string guid ) : void
guid string The GUID.
return void

DeleteCategory() public method

Deletes the category.
public DeleteCategory ( string guid ) : void
guid string The unique identifier.
return void

DeleteDefinedType() public method

Deletes the DefinedType.
public DeleteDefinedType ( string guid ) : void
guid string The GUID.
return void

DeleteDefinedValue() public method

Deletes the DefinedValue.
public DeleteDefinedValue ( string guid ) : void
guid string The GUID.
return void

DeleteEntityType() public method

Deletes the EntityType.
public DeleteEntityType ( string guid ) : void
guid string The GUID.
return void

DeleteFieldType() public method

Deletes the FieldType.
public DeleteFieldType ( string guid ) : void
guid string The GUID.
return void

DeleteLayout() public method

Deletes the Layout.
public DeleteLayout ( string guid ) : void
guid string The GUID.
return void

DeletePage() public method

Deletes the Page and any PageViews that use the page.
public DeletePage ( string guid ) : void
guid string The GUID.
return void

DeleteSecurityAuth() public method

Deletes the security auth record.
public DeleteSecurityAuth ( string guid ) : void
guid string The GUID.
return void

DeleteSecurityAuthForBlock() public method

Deletes the security authentication for block.
public DeleteSecurityAuthForBlock ( string blockGuid ) : void
blockGuid string The block unique identifier.
return void

DeleteSecurityAuthForGroupType() public method

Deletes the security authentication for groupType.
public DeleteSecurityAuthForGroupType ( string groupTypeGuid ) : void
groupTypeGuid string The groupType unique identifier.
return void

DeleteSecurityAuthForPage() public method

Deletes the security authentication for page.
public DeleteSecurityAuthForPage ( string pageGuid ) : void
pageGuid string The page unique identifier.
return void

DeleteSecurityRoleGroup() public method

Deletes the security role group.
public DeleteSecurityRoleGroup ( string guid ) : void
guid string The GUID.
return void

MovePage() public method

Moves the Page to the new given parent page.
public MovePage ( string pageGuid, string parentPageGuid ) : void
pageGuid string The page GUID.
parentPageGuid string The parent page GUID.
return void

UpdateBlockType() public method

Updates the BlockType by path (if it exists); otherwise it inserts a new record. In either case it will be marked IsSystem.
public UpdateBlockType ( string name, string description, string path, string category, string guid ) : void
name string The name.
description string The description.
path string The path.
category string The category.
guid string The GUID.
return void

UpdateBlockTypeAttribute() public method

Updates the BlockType Attribute for the given blocktype and key (if it exists); otherwise it inserts a new record.
public UpdateBlockTypeAttribute ( string blockTypeGuid, string fieldTypeGuid, string name, string key, string category, string description, int order, string defaultValue, string guid ) : void
blockTypeGuid string
fieldTypeGuid string
name string
key string
category string
description string
order int
defaultValue string
guid string
return void

UpdateCategory() public method

Updates the category.
public UpdateCategory ( string entityTypeGuid, string name, string iconCssClass, string description, string guid ) : void
entityTypeGuid string The entity type unique identifier.
name string The name.
iconCssClass string The icon CSS class.
description string The description.
guid string The unique identifier.
return void

UpdateDefinedValue() public method

Updates (or Adds) the defined value for the given DefinedType.
public UpdateDefinedValue ( string definedTypeGuid, string name, string description, string guid, bool isSystem = true ) : void
definedTypeGuid string The defined type GUID.
name string The name.
description string The description.
guid string The GUID.
isSystem bool if set to true [is system].
return void

UpdateEntityType() public method

Updates the EntityType by name (if it exists); otherwise it inserts a new record.
public UpdateEntityType ( string name, string guid, bool isEntity, bool isSecured ) : void
name string The name.
guid string The GUID.
isEntity bool if set to true [is entity].
isSecured bool if set to true [is secured].
return void

UpdateEntityType() public method

Updates the EntityType by name (if it exists); otherwise it inserts a new record.
public UpdateEntityType ( string name, string friendlyName, string assemblyName, bool isEntity, bool isSecured, string guid ) : void
name string The name.
friendlyName string Name of the friendly.
assemblyName string Name of the assembly.
isEntity bool if set to true [is entity].
isSecured bool if set to true [is secured].
guid string The GUID.
return void

UpdateEntityTypeMultiValueFieldType() public method

Updates the EntityType MultiValueFieldType
public UpdateEntityTypeMultiValueFieldType ( string entityTypeName, string fieldTypeGuid ) : void
entityTypeName string Name of the entity type.
fieldTypeGuid string The field type unique identifier.
return void

UpdateEntityTypeSingleValueFieldType() public method

Updates the EntityType SingleValueFieldType
public UpdateEntityTypeSingleValueFieldType ( string entityTypeName, string fieldTypeGuid ) : void
entityTypeName string Name of the entity type.
fieldTypeGuid string The field type unique identifier.
return void

UpdateFieldType() public method

Updates the FieldType by assembly and className (if it exists); otherwise it inserts a new record.
public UpdateFieldType ( string name, string description, string assembly, string className, string guid, bool IsSystem = true ) : void
name string The name.
description string The description.
assembly string The assembly.
className string Name of the class.
guid string The GUID.
IsSystem bool if set to true [is system].
return void

UpdatePersonAttribute() public method

Updates the BlockType Attribute for the given blocktype and key (if it exists); otherwise it inserts a new record.
public UpdatePersonAttribute ( string fieldTypeGuid, string categoryGuid, string name, string key, string iconCssClass, string description, int order, string defaultValue, string guid ) : void
fieldTypeGuid string
categoryGuid string
name string
key string
iconCssClass string
description string
order int
defaultValue string
guid string
return void

UpdatePersonBadge() public method

Updates the PersonBadge by Guid (if it exists); otherwise it inserts a new record.
public UpdatePersonBadge ( string name, string description, string entityTypeName, int order, string guid ) : void
name string The name.
description string The description.
entityTypeName string Name of the entity type.
order int The order.
guid string The unique identifier.
return void