You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

using OpenDBDiff.Abstractions.Schema;
using OpenDBDiff.Abstractions.Schema.Model;
using OpenDBDiff.SqlServer.Schema.Model;
namespace OpenDBDiff.SqlServer.Schema.Compare
{
internal class CompareFullTextIndex : CompareBase<FullTextIndex>
{
protected override void DoNew<Root>(SchemaList<FullTextIndex, Root> originFields, FullTextIndex node)
{
FullTextIndex newNode = (FullTextIndex)node.Clone(originFields.Parent);
newNode.Status = ObjectStatus.Create;
originFields.Add(newNode);
}
protected override void DoUpdate<Root>(SchemaList<FullTextIndex, Root> originFields, FullTextIndex node)
{
if (!node.Compare(originFields[node.FullName]))
{
FullTextIndex newNode = (FullTextIndex)node.Clone(originFields.Parent);
if (node.IsDisabled != originFields[node.FullName].IsDisabled)
newNode.Status += (int)ObjectStatus.Disabled;
else
newNode.Status += (int)ObjectStatus.Alter;
originFields[node.FullName] = newNode;
}
}
}
}