public sealed class MappingRule : IMessage<MappingRule>, IEquatable<MappingRule>, IDeepCloneable<MappingRule>, IBufferMessage, IMessage
Reference documentation and code samples for the Database Migration v1 API class MappingRule.
Definition of a transformation that is to be applied to a group of entities
in the source schema. Several such transformations can be applied to an
entity sequentially to define the corresponding entity in the target schema.
public ConditionalColumnSetValue ConditionalColumnSetValue { get; set; }
Optional. Rule to specify how the data contained in a column should be
transformed (such as trimmed, rounded, etc) provided that the data meets
certain criteria.
Output only. The revision ID of the mapping rule.
A new revision is committed whenever the mapping rule is changed in any
way. The format is an 8-character hexadecimal string.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eMappingRule\u003c/code\u003e class for the Database Migration v1 API is 2.5.0, with previous versions ranging from 1.0.0 to 2.4.0 available for reference.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMappingRule\u003c/code\u003e class defines transformations that can be applied to entities in a source schema, allowing for sequential modifications to define the corresponding target schema.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMappingRule\u003c/code\u003e class offers properties for various types of data transformation rules, such as \u003ccode\u003eConditionalColumnSetValue\u003c/code\u003e, \u003ccode\u003eConvertRowidColumn\u003c/code\u003e, \u003ccode\u003eEntityMove\u003c/code\u003e, and more.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eMappingRule\u003c/code\u003e instance includes a required \u003ccode\u003eFilter\u003c/code\u003e property to specify which entities the rule applies to, a \u003ccode\u003eRuleOrder\u003c/code\u003e to define the order of application, and a \u003ccode\u003eRuleScope\u003c/code\u003e to determine the scope.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMappingRule\u003c/code\u003e class also offers properties related to its state and history, such as the \u003ccode\u003eRevisionCreateTime\u003c/code\u003e, \u003ccode\u003eRevisionId\u003c/code\u003e, and \u003ccode\u003eState\u003c/code\u003e of a given instance.\u003c/p\u003e\n"]]],[],null,["# Database Migration v1 API - Class MappingRule (2.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRule)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/2.4.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/2.3.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/2.2.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/2.1.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/2.0.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/1.2.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/1.1.0/Google.Cloud.CloudDms.V1.MappingRule)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/1.0.0/Google.Cloud.CloudDms.V1.MappingRule) \n\n public sealed class MappingRule : IMessage\u003cMappingRule\u003e, IEquatable\u003cMappingRule\u003e, IDeepCloneable\u003cMappingRule\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Database Migration v1 API class MappingRule.\n\nDefinition of a transformation that is to be applied to a group of entities\nin the source schema. Several such transformations can be applied to an\nentity sequentially to define the corresponding entity in the target schema. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e MappingRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[MappingRule](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[MappingRule](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[MappingRule](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.CloudDms.V1](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.CloudDms.V1.dll\n\nConstructors\n------------\n\n### MappingRule()\n\n public MappingRule()\n\n### MappingRule(MappingRule)\n\n public MappingRule(MappingRule other)\n\nProperties\n----------\n\n### ConditionalColumnSetValue\n\n public ConditionalColumnSetValue ConditionalColumnSetValue { get; set; }\n\nOptional. Rule to specify how the data contained in a column should be\ntransformed (such as trimmed, rounded, etc) provided that the data meets\ncertain criteria.\n\n### ConvertRowidColumn\n\n public ConvertRowIdToColumn ConvertRowidColumn { get; set; }\n\nOptional. Rule to specify how multiple tables should be converted with an\nadditional rowid column.\n\n### DetailsCase\n\n public MappingRule.DetailsOneofCase DetailsCase { get; }\n\n### DisplayName\n\n public string DisplayName { get; set; }\n\nOptional. A human readable name\n\n### EntityMove\n\n public EntityMove EntityMove { get; set; }\n\nOptional. Rule to specify how multiple entities should be relocated into\na different schema.\n\n### Filter\n\n public MappingRuleFilter Filter { get; set; }\n\nRequired. The rule filter\n\n### FilterTableColumns\n\n public FilterTableColumns FilterTableColumns { get; set; }\n\nOptional. Rule to specify the list of columns to include or exclude from\na table.\n\n### MappingRuleName\n\n public MappingRuleName MappingRuleName { get; set; }\n\n[MappingRuleName](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRuleName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.CloudDms.V1/latest/Google.Cloud.CloudDms.V1.MappingRule#Google_Cloud_CloudDms_V1_MappingRule_Name) resource name property.\n\n### MultiColumnDataTypeChange\n\n public MultiColumnDatatypeChange MultiColumnDataTypeChange { get; set; }\n\nOptional. Rule to specify how multiple columns should be converted to a\ndifferent data type.\n\n### MultiEntityRename\n\n public MultiEntityRename MultiEntityRename { get; set; }\n\nOptional. Rule to specify how multiple entities should be renamed.\n\n### Name\n\n public string Name { get; set; }\n\nFull name of the mapping rule resource, in the form of:\nprojects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}.\n\n### RevisionCreateTime\n\n public Timestamp RevisionCreateTime { get; set; }\n\nOutput only. The timestamp that the revision was created.\n\n### RevisionId\n\n public string RevisionId { get; set; }\n\nOutput only. The revision ID of the mapping rule.\nA new revision is committed whenever the mapping rule is changed in any\nway. The format is an 8-character hexadecimal string.\n\n### RuleOrder\n\n public long RuleOrder { get; set; }\n\nRequired. The order in which the rule is applied. Lower order rules are\napplied before higher value rules so they may end up being overridden.\n\n### RuleScope\n\n public DatabaseEntityType RuleScope { get; set; }\n\nRequired. The rule scope\n\n### SetTablePrimaryKey\n\n public SetTablePrimaryKey SetTablePrimaryKey { get; set; }\n\nOptional. Rule to specify the primary key for a table\n\n### SingleColumnChange\n\n public SingleColumnChange SingleColumnChange { get; set; }\n\nOptional. Rule to specify how a single column is converted.\n\n### SingleEntityRename\n\n public SingleEntityRename SingleEntityRename { get; set; }\n\nOptional. Rule to specify how a single entity should be renamed.\n\n### SinglePackageChange\n\n public SinglePackageChange SinglePackageChange { get; set; }\n\nOptional. Rule to specify how a single package is converted.\n\n### SourceSqlChange\n\n public SourceSqlChange SourceSqlChange { get; set; }\n\nOptional. Rule to change the sql code for an entity, for example,\nfunction, procedure.\n\n### State\n\n public MappingRule.Types.State State { get; set; }\n\nOptional. The mapping rule state"]]