SchemaCompareScriptService.GenerateUpdatePlan 方法
由 DatabaseSchemaProvider 调用时生成完整的更新脚本。
命名空间: Microsoft.Data.Schema.Tools.Compare.Schema
程序集: Microsoft.Data.Schema.Tools(在 Microsoft.Data.Schema.Tools.dll 中)
语法
声明
Public Overridable Sub GenerateUpdatePlan ( _
comparisonResult As ModelComparisonResult, _
source As DataSchemaModel, _
target As DataSchemaModel, _
excludedElements As HashSet(Of IModelElement), _
sourceModelProvider As ISchemaCompareModelProvider, _
targetModelProvider As ISchemaCompareModelProvider, _
configurationOptions As SchemaDeploymentOptions, _
<OutAttribute> ByRef plan As DeploymentPlan, _
<OutAttribute> ByRef errorsAndWarnings As ErrorManager _
)
public virtual void GenerateUpdatePlan(
ModelComparisonResult comparisonResult,
DataSchemaModel source,
DataSchemaModel target,
HashSet<IModelElement> excludedElements,
ISchemaCompareModelProvider sourceModelProvider,
ISchemaCompareModelProvider targetModelProvider,
SchemaDeploymentOptions configurationOptions,
out DeploymentPlan plan,
out ErrorManager errorsAndWarnings
)
public:
virtual void GenerateUpdatePlan(
ModelComparisonResult^ comparisonResult,
DataSchemaModel^ source,
DataSchemaModel^ target,
HashSet<IModelElement^>^ excludedElements,
ISchemaCompareModelProvider^ sourceModelProvider,
ISchemaCompareModelProvider^ targetModelProvider,
SchemaDeploymentOptions^ configurationOptions,
[OutAttribute] DeploymentPlan^% plan,
[OutAttribute] ErrorManager^% errorsAndWarnings
)
abstract GenerateUpdatePlan :
comparisonResult:ModelComparisonResult *
source:DataSchemaModel *
target:DataSchemaModel *
excludedElements:HashSet<IModelElement> *
sourceModelProvider:ISchemaCompareModelProvider *
targetModelProvider:ISchemaCompareModelProvider *
configurationOptions:SchemaDeploymentOptions *
plan:DeploymentPlan byref *
errorsAndWarnings:ErrorManager byref -> unit
override GenerateUpdatePlan :
comparisonResult:ModelComparisonResult *
source:DataSchemaModel *
target:DataSchemaModel *
excludedElements:HashSet<IModelElement> *
sourceModelProvider:ISchemaCompareModelProvider *
targetModelProvider:ISchemaCompareModelProvider *
configurationOptions:SchemaDeploymentOptions *
plan:DeploymentPlan byref *
errorsAndWarnings:ErrorManager byref -> unit
public function GenerateUpdatePlan(
comparisonResult : ModelComparisonResult,
source : DataSchemaModel,
target : DataSchemaModel,
excludedElements : HashSet<IModelElement>,
sourceModelProvider : ISchemaCompareModelProvider,
targetModelProvider : ISchemaCompareModelProvider,
configurationOptions : SchemaDeploymentOptions,
plan : DeploymentPlan,
errorsAndWarnings : ErrorManager
)
参数
- comparisonResult
类型:Microsoft.Data.Schema.SchemaModel.ModelComparisonResult
一个 ModelComparisonResult 对象。
- source
类型:Microsoft.Data.Schema.SchemaModel.DataSchemaModel
一个表示源模型的 DataSchemaModel 对象。
- target
类型:Microsoft.Data.Schema.SchemaModel.DataSchemaModel
一个表示目标模型的 DataSchemaModel 对象。
- excludedElements
类型:System.Collections.Generic.HashSet<IModelElement>
IModelElement 对象的 HashSet<T>,这些对象表示用户选择要从计划中排除的那些元素。
- sourceModelProvider
类型:Microsoft.Data.Schema.Tools.Compare.Schema.ISchemaCompareModelProvider
一个 ISchemaCompareModelProvider,表示源提供程序。
- targetModelProvider
类型:Microsoft.Data.Schema.Tools.Compare.Schema.ISchemaCompareModelProvider
一个 ISchemaCompareModelProvider,表示目标提供程序。
- configurationOptions
类型:Microsoft.Data.Schema.Build.SchemaDeploymentOptions
一个 SchemaDeploymentOptions 对象,指定在创建计划时要使用的配置。
- plan
类型:Microsoft.Data.Schema.Build.DeploymentPlan%
(输出)一个 DeploymentPlan 对象。
- errorsAndWarnings
类型:Microsoft.Data.Schema.ErrorManager%
(输出)一个 ErrorManager 对象,其中包含在生成计划过程中发生的任何错误。
备注
这是此方法的基本过程:
调用 OnStartGeneratePlan 方法。
如果要为数据库创建部署计划:
调用 CreateDeploymentController 方法。
调用 OnBeforeGeneratePlan 方法。
使用派生部署控制器的 ISchemaDeploymentController.CreatePlan 方法创建计划。
使用派生部署控制器的 ISchemaDeploymentController.VerifyPlan 方法验证计划。
ErrorManager 中记录任何异常
调用 OnFinishGeneratePlan 方法。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。