mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-07 01:25:41 -05:00
Update STS changes to be backward compatible with scmpOpen (#2031)
* Update STS changes to be backward compatible with scmpOpen * Update cleanup code * Fix test.
This commit is contained in:
@@ -173,9 +173,19 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
if (fs != null)
|
||||
{
|
||||
DacExtractTarget extractTarget;
|
||||
if (Enum.TryParse<DacExtractTarget>(fs.FirstOrDefault().Value, out extractTarget))
|
||||
if(fs.FirstOrDefault() != null) // it is possible that this value is not set
|
||||
{
|
||||
endpointInfo.ExtractTarget = extractTarget;
|
||||
if (Enum.TryParse<DacExtractTarget>(fs.FirstOrDefault().Value, out extractTarget))
|
||||
{
|
||||
endpointInfo.ExtractTarget = extractTarget;
|
||||
} else
|
||||
{
|
||||
endpointInfo.ExtractTarget = DacExtractTarget.SchemaObjectType; // set default but log an error
|
||||
Logger.Write(TraceEventType.Error, string.Format("Schema compare open scmp operation failed during xml parsing with unknown ExtractTarget"));
|
||||
}
|
||||
} else
|
||||
{
|
||||
endpointInfo.ExtractTarget = DacExtractTarget.SchemaObjectType; // set the default if this value doesn't already exist in the scmp file
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user