Initial commit
This commit is contained in:
66
OpenDBDiff.Schema.SQLServer.Generates/Options/SqlOption.cs
Normal file
66
OpenDBDiff.Schema.SQLServer.Generates/Options/SqlOption.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using OpenDBDiff.Schema.Model;
|
||||
using System;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOption : IOption
|
||||
{
|
||||
public SqlOption()
|
||||
{
|
||||
Defaults = new SqlOptionDefault();
|
||||
Ignore = new SqlOptionIgnore(true);
|
||||
Script = new SqlOptionScript();
|
||||
Filters = new SqlOptionFilter();
|
||||
Comparison = new SqlOptionComparison();
|
||||
}
|
||||
|
||||
public SqlOption(Boolean defaultFilter)
|
||||
{
|
||||
Defaults = new SqlOptionDefault();
|
||||
Ignore = new SqlOptionIgnore(defaultFilter);
|
||||
Script = new SqlOptionScript();
|
||||
Filters = new SqlOptionFilter();
|
||||
Comparison = new SqlOptionComparison();
|
||||
}
|
||||
|
||||
public SqlOption(IOption option)
|
||||
{
|
||||
Defaults = new SqlOptionDefault(option.Defaults);
|
||||
Ignore = new SqlOptionIgnore(option.Ignore);
|
||||
Script = new SqlOptionScript(option.Script);
|
||||
Filters = new SqlOptionFilter(option.Filters);
|
||||
Comparison = new SqlOptionComparison(option.Comparison);
|
||||
}
|
||||
|
||||
public SqlOptionComparison Comparison { get; set; }
|
||||
|
||||
public SqlOptionFilter Filters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the option filter.
|
||||
/// </summary>
|
||||
/// <value>The option filter.</value>
|
||||
public SqlOptionIgnore Ignore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the option default.
|
||||
/// </summary>
|
||||
/// <value>The option default.</value>
|
||||
public SqlOptionDefault Defaults { get; set; }
|
||||
|
||||
public SqlOptionScript Script { get; set; }
|
||||
|
||||
IOptionFilter IOption.Filters { get { return Filters; } }
|
||||
IOptionsContainer<string> IOption.Defaults { get { return Defaults; } }
|
||||
IOptionsContainer<bool> IOption.Ignore { get { return Ignore; } }
|
||||
|
||||
IOptionsContainer<bool> IOption.Script { get { return Script; } }
|
||||
|
||||
IOptionComparison IOption.Comparison { get { return Comparison; } }
|
||||
|
||||
public string Serialize()
|
||||
{
|
||||
return this.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenDBDiff.Schema.Model;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionComparison : Schema.Model.IOptionComparison
|
||||
{
|
||||
|
||||
public enum CaseSensityOptions
|
||||
{
|
||||
Automatic = 0,
|
||||
CaseInsensity = 1,
|
||||
CaseSensity = 2
|
||||
}
|
||||
|
||||
public SqlOptionComparison()
|
||||
{
|
||||
CaseSensityInCode = CaseSensityOptions.CaseInsensity;
|
||||
IgnoreWhiteSpacesInCode = false;
|
||||
}
|
||||
|
||||
public SqlOptionComparison(IOptionComparison comparison)
|
||||
{
|
||||
this.ReloadComparisonOnUpdate = comparison.ReloadComparisonOnUpdate;
|
||||
var options = comparison.GetOptions();
|
||||
IgnoreWhiteSpacesInCode = bool.Parse(options["IgnoreWhiteSpacesInCode"]);
|
||||
CaseSensityInCode = (CaseSensityOptions)Enum.Parse(typeof(CaseSensityOptions), options["CaseSensityInCode"], true);
|
||||
CaseSensityType = (CaseSensityOptions)Enum.Parse(typeof(CaseSensityOptions), options["CaseSensityType"], true);
|
||||
}
|
||||
|
||||
public bool IgnoreWhiteSpacesInCode { get; set; }
|
||||
public bool ReloadComparisonOnUpdate { get; set; }
|
||||
|
||||
|
||||
public CaseSensityOptions CaseSensityInCode { get; set; }
|
||||
|
||||
public CaseSensityOptions CaseSensityType { get; set; }
|
||||
|
||||
public IDictionary<string, string> GetOptions()
|
||||
{
|
||||
Dictionary<string, string> options = new Dictionary<string, string>();
|
||||
options.Add("IgnoreWhiteSpacesInCode", IgnoreWhiteSpacesInCode.ToString());
|
||||
options.Add("ReloadComparisonOnUpdate", ReloadComparisonOnUpdate.ToString());
|
||||
options.Add("CaseSensityInCode", CaseSensityInCode.ToString());
|
||||
options.Add("CaseSensityType", CaseSensityType.ToString());
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenDBDiff.Schema.Model;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionDefault : Schema.Model.IOptionsContainer<string>
|
||||
{
|
||||
private string defaultIntegerValue = "0";
|
||||
private string defaultRealValue = "0.0";
|
||||
private string defaultTextValue = "''";
|
||||
private string defaultDateValue = "getdate()";
|
||||
private string defaultVariantValue = "''";
|
||||
private string defaultNTextValue = "N''";
|
||||
private string defaultBlobValue = "0x";
|
||||
private string defaultUniqueValue = "NEWID()";
|
||||
private Boolean useDefaultValueIfExists = true;
|
||||
private string defaultTime = "00:00:00";
|
||||
private string defaultXml = "";
|
||||
|
||||
public SqlOptionDefault(IOptionsContainer<string> optionsContainer)
|
||||
{
|
||||
var options = optionsContainer.GetOptions();
|
||||
defaultIntegerValue = options["defaultIntegerValue"];
|
||||
defaultRealValue = options["defaultRealValue"];
|
||||
defaultTextValue = options["defaultTextValue"];
|
||||
defaultDateValue = options["defaultDateValue"];
|
||||
defaultVariantValue = options["defaultVariantValue"];
|
||||
defaultNTextValue = options["defaultNTextValue"];
|
||||
defaultBlobValue = options["defaultBlobValue"];
|
||||
defaultUniqueValue = options["defaultUniqueValue"];
|
||||
useDefaultValueIfExists = bool.Parse(options["useDefaultValueIfExists"]);
|
||||
defaultTime = options["defaultTime"];
|
||||
defaultXml = options["defaultXml"];
|
||||
}
|
||||
|
||||
public SqlOptionDefault()
|
||||
{
|
||||
}
|
||||
|
||||
public string DefaultXml
|
||||
{
|
||||
get { return defaultXml; }
|
||||
set { defaultXml = value; }
|
||||
}
|
||||
|
||||
public string DefaultTime
|
||||
{
|
||||
get { return defaultTime; }
|
||||
set { defaultTime = value; }
|
||||
}
|
||||
|
||||
public IDictionary<string, string> GetOptions()
|
||||
{
|
||||
Dictionary<string, string> options = new Dictionary<string, string>();
|
||||
options.Add("defaultIntegerValue", defaultIntegerValue);
|
||||
options.Add("defaultRealValue", defaultRealValue);
|
||||
options.Add("defaultTextValue", defaultTextValue);
|
||||
options.Add("defaultDateValue", defaultDateValue);
|
||||
options.Add("defaultVariantValue", defaultVariantValue);
|
||||
options.Add("defaultNTextValue", defaultNTextValue);
|
||||
options.Add("defaultBlobValue", defaultBlobValue);
|
||||
options.Add("defaultUniqueValue", defaultUniqueValue);
|
||||
options.Add("useDefaultValueIfExists", useDefaultValueIfExists.ToString());
|
||||
options.Add("defaultTime", defaultTime);
|
||||
options.Add("defaultXml", defaultXml);
|
||||
return options;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether use default value if exists.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if use default value if exists; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public Boolean UseDefaultValueIfExists
|
||||
{
|
||||
get { return useDefaultValueIfExists; }
|
||||
set { useDefaultValueIfExists = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default unique (uniqueidentifier) values.
|
||||
/// </summary>
|
||||
/// <value>The default unique value.</value>
|
||||
public string DefaultUniqueValue
|
||||
{
|
||||
get { return defaultUniqueValue; }
|
||||
set { defaultUniqueValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default BLOB (varbinary,image, bynary) values.
|
||||
/// </summary>
|
||||
/// <value>The default BLOB value.</value>
|
||||
public string DefaultBlobValue
|
||||
{
|
||||
get { return defaultBlobValue; }
|
||||
set { defaultBlobValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default Unicode text (nvarchar,nchar,ntext) values.
|
||||
/// </summary>
|
||||
/// <value>The default N text value.</value>
|
||||
public string DefaultNTextValue
|
||||
{
|
||||
get { return defaultNTextValue; }
|
||||
set { defaultNTextValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default sql_variant values.
|
||||
/// </summary>
|
||||
/// <value>The default variant value.</value>
|
||||
public string DefaultVariantValue
|
||||
{
|
||||
get { return defaultVariantValue; }
|
||||
set { defaultVariantValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default date (datetime,smalldatetime) values.
|
||||
/// </summary>
|
||||
/// <value>The default date value.</value>
|
||||
public string DefaultDateValue
|
||||
{
|
||||
get { return defaultDateValue; }
|
||||
set { defaultDateValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default text (varchar,char,text) values.
|
||||
/// </summary>
|
||||
/// <value>The default text value.</value>
|
||||
public string DefaultTextValue
|
||||
{
|
||||
get { return defaultTextValue; }
|
||||
set { defaultTextValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default real (decimal,money,numeric,float) value.
|
||||
/// </summary>
|
||||
/// <value>The default real value.</value>
|
||||
public string DefaultRealValue
|
||||
{
|
||||
get { return defaultRealValue; }
|
||||
set { defaultRealValue = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default integer (int, smallint, bigint, tinyint, bit) value.
|
||||
/// </summary>
|
||||
/// <value>The default integer value.</value>
|
||||
public string DefaultIntegerValue
|
||||
{
|
||||
get { return defaultIntegerValue; }
|
||||
set { defaultIntegerValue = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using OpenDBDiff.Schema.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionFilter : IOptionFilter
|
||||
{
|
||||
public SqlOptionFilter()
|
||||
{
|
||||
Items = new List<SqlOptionFilterItem>
|
||||
{
|
||||
new SqlOptionFilterItem(ObjectType.Table, "dbo.dtproperties"),
|
||||
new SqlOptionFilterItem(ObjectType.Assembly, "Microsoft.SqlServer.Types"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_accessadmin"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_backupoperator"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_datareader"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_datawriter"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_ddladmin"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_denydatareader"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_denydatawriter"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_owner"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "db_securityadmin"),
|
||||
//new SqlOptionFilterItem(ObjectType.Schema, "dbo"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "guest"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "INFORMATION_SCHEMA"),
|
||||
new SqlOptionFilterItem(ObjectType.Schema, "sys")
|
||||
};
|
||||
}
|
||||
|
||||
public SqlOptionFilter(IOptionFilter optionFilter)
|
||||
{
|
||||
Items = new List<SqlOptionFilterItem>();
|
||||
var options = optionFilter.GetOptions();
|
||||
foreach (var pair in options)
|
||||
{
|
||||
Items.Add(
|
||||
new SqlOptionFilterItem(
|
||||
objectType: (ObjectType)Enum.Parse(typeof(ObjectType), pair.Value, true),
|
||||
filterPattern: pair.Key
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public IList<SqlOptionFilterItem> Items { get; private set; }
|
||||
|
||||
public IDictionary<string, string> GetOptions()
|
||||
{
|
||||
Dictionary<string, string> values = new Dictionary<string, string>();
|
||||
for (int i = 0; i < Items.Count; i++)
|
||||
{
|
||||
values.Add(Items[i].FilterPattern, Items[i].ObjectType.ToString());
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
public bool IsItemIncluded(ISchemaBase item)
|
||||
{
|
||||
return !Items.Any(i => i.IsMatch(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using OpenDBDiff.Schema.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionFilterItem
|
||||
{
|
||||
public SqlOptionFilterItem(ObjectType objectType, string filterPattern)
|
||||
{
|
||||
this.ObjectType = objectType;
|
||||
this.FilterPattern = filterPattern;
|
||||
}
|
||||
|
||||
public ObjectType ObjectType { get; set; }
|
||||
|
||||
public string FilterPattern { get; set; }
|
||||
|
||||
public bool IsMatch(ISchemaBase item)
|
||||
{
|
||||
if (item.ObjectType.Equals(this.ObjectType) && ValueSatisfiesCriteria(item.Name, this.FilterPattern))
|
||||
return true;
|
||||
else if (this.IsSchemaMatch(item))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsSchemaMatch(ISchemaBase item)
|
||||
{
|
||||
if (item.Owner == null) return false;
|
||||
return this.ObjectType.Equals(ObjectType.Schema) && ValueSatisfiesCriteria(item.Owner, this.FilterPattern);
|
||||
}
|
||||
|
||||
private static Lazy<Dictionary<string, Tuple<string, string>>> patternReplacements =
|
||||
new Lazy<Dictionary<string, Tuple<string, string>>>(() =>
|
||||
{
|
||||
return new Dictionary<string, Tuple<string, string>>
|
||||
{
|
||||
// key: the literal string to match
|
||||
// value: a tuple: first item: the search pattern, second item: the replacement
|
||||
{ @"~~", new Tuple<string, string>(@"~~", "~") },
|
||||
{ @"~*", new Tuple<string, string>(@"~\*", @"\*") },
|
||||
{ @"~?", new Tuple<string, string>(@"~\?", @"\?") },
|
||||
{ @"?", new Tuple<string, string>(@"\?", ".?") },
|
||||
{ @"*", new Tuple<string, string>(@"\*", ".*") }
|
||||
};
|
||||
});
|
||||
|
||||
private static bool ValueSatisfiesCriteria(string value, string pattern)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value) || string.IsNullOrWhiteSpace(pattern)) return false;
|
||||
|
||||
// if criteria is a regular expression, use regex
|
||||
if (pattern.IndexOfAny(new[] { '*', '?' }) > -1)
|
||||
{
|
||||
var regex = Regex.Replace(
|
||||
pattern,
|
||||
"(" + string.Join(
|
||||
"|",
|
||||
patternReplacements.Value.Values.Select(t => t.Item1))
|
||||
+ ")",
|
||||
m => patternReplacements.Value[m.Value].Item2);
|
||||
regex = $"^{regex}$";
|
||||
|
||||
return Regex.IsMatch(value, regex, RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
// straight string comparison
|
||||
return string.Equals(value, pattern, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
#region Overrides
|
||||
|
||||
public static bool operator ==(SqlOptionFilterItem x, SqlOptionFilterItem y)
|
||||
{
|
||||
return Object.Equals(x, y);
|
||||
}
|
||||
|
||||
public static bool operator !=(SqlOptionFilterItem x, SqlOptionFilterItem y)
|
||||
{
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SqlOptionFilterItem fi = obj as SqlOptionFilterItem;
|
||||
if (fi == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this.ObjectType.Equals(fi.ObjectType) && this.FilterPattern.Equals(fi.FilterPattern, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
long hash = 13;
|
||||
hash = hash + this.ObjectType.GetHashCode() + this.FilterPattern.ToLowerInvariant().GetHashCode();
|
||||
return Convert.ToInt32(hash & 0x7fffffff);
|
||||
}
|
||||
|
||||
#endregion Overrides
|
||||
}
|
||||
}
|
||||
231
OpenDBDiff.Schema.SQLServer.Generates/Options/SqlOptionIgnore.cs
Normal file
231
OpenDBDiff.Schema.SQLServer.Generates/Options/SqlOptionIgnore.cs
Normal file
@@ -0,0 +1,231 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenDBDiff.Schema.Model;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionIgnore : Schema.Model.IOptionsContainer<bool>
|
||||
{
|
||||
public SqlOptionIgnore(bool defaultValue)
|
||||
{
|
||||
FilterPartitionFunction = true;
|
||||
FilterPartitionScheme = true;
|
||||
FilterIndexFilter = true;
|
||||
FilterIndex = true;
|
||||
FilterConstraintPK = true;
|
||||
FilterConstraintFK = true;
|
||||
FilterConstraintUK = true;
|
||||
FilterConstraintCheck = true;
|
||||
FilterIndexFillFactor = true;
|
||||
FilterIndexIncludeColumns = true;
|
||||
FilterIndexRowLock = true;
|
||||
FilterColumnOrder = true;
|
||||
FilterColumnIdentity = true;
|
||||
FilterColumnCollation = true;
|
||||
FilterNotForReplication = true;
|
||||
FilterUsers = true;
|
||||
FilterRoles = true;
|
||||
FilterCLRFunction = true;
|
||||
FilterCLRTrigger = true;
|
||||
FilterCLRUDT = true;
|
||||
FilterCLRStoredProcedure = true;
|
||||
FilterFullText = true;
|
||||
FilterFullTextPath = false;
|
||||
FilterTableLockEscalation = true;
|
||||
FilterTableChangeTracking = true;
|
||||
FilterConstraint = defaultValue;
|
||||
FilterFunction = defaultValue;
|
||||
FilterStoredProcedure = defaultValue;
|
||||
FilterView = defaultValue;
|
||||
FilterTable = defaultValue;
|
||||
FilterTableOption = defaultValue;
|
||||
FilterUserDataType = defaultValue;
|
||||
FilterTrigger = defaultValue;
|
||||
FilterSchema = defaultValue;
|
||||
FilterXMLSchema = defaultValue;
|
||||
FilterTableFileGroup = defaultValue;
|
||||
FilterExtendedProperties = defaultValue;
|
||||
FilterDDLTriggers = defaultValue;
|
||||
FilterSynonyms = defaultValue;
|
||||
FilterRules = defaultValue;
|
||||
FilterAssemblies = defaultValue;
|
||||
}
|
||||
|
||||
public SqlOptionIgnore(IOptionsContainer<bool> optionsContainer)
|
||||
{
|
||||
var options = optionsContainer.GetOptions();
|
||||
FilterPartitionFunction = options["FilterPartitionFunction"];
|
||||
FilterPartitionScheme = options["FilterPartitionScheme"];
|
||||
FilterIndexFilter = options["FilterIndexFilter"];
|
||||
FilterIndex = options["FilterIndex"];
|
||||
FilterConstraintPK = options["FilterConstraintPK"];
|
||||
FilterConstraintFK = options["FilterConstraintFK"];
|
||||
FilterConstraintUK = options["FilterConstraintUK"];
|
||||
FilterConstraintCheck = options["FilterConstraintCheck"];
|
||||
FilterIndexFillFactor = options["FilterIndexFillFactor"];
|
||||
FilterIndexIncludeColumns = options["FilterIndexIncludeColumns"];
|
||||
FilterIndexRowLock = options["FilterIndexRowLock"];
|
||||
FilterColumnOrder = options["FilterColumnOrder"];
|
||||
FilterColumnIdentity = options["FilterColumnIdentity"];
|
||||
FilterColumnCollation = options["FilterColumnCollation"];
|
||||
FilterNotForReplication = options["FilterNotForReplication"];
|
||||
FilterUsers = options["FilterUsers"];
|
||||
FilterRoles = options["FilterRoles"];
|
||||
FilterCLRFunction = options["FilterCLRFunction"];
|
||||
FilterCLRTrigger = options["FilterCLRTrigger"];
|
||||
FilterCLRUDT = options["FilterCLRUDT"];
|
||||
FilterCLRStoredProcedure = options["FilterCLRStoredProcedure"];
|
||||
FilterFullText = options["FilterFullText"];
|
||||
FilterFullTextPath = options["FilterFullTextPath"];
|
||||
FilterTableLockEscalation = options["FilterTableLockEscalation"];
|
||||
FilterTableChangeTracking = options["FilterTableChangeTracking"];
|
||||
FilterConstraint = options["FilterConstraint"];
|
||||
FilterFunction = options["FilterFunction"];
|
||||
FilterStoredProcedure = options["FilterStoredProcedure"];
|
||||
FilterView = options["FilterView"];
|
||||
FilterTable = options["FilterTable"];
|
||||
FilterTableOption = options["FilterTableOption"];
|
||||
FilterUserDataType = options["FilterUserDataType"];
|
||||
FilterTrigger = options["FilterTrigger"];
|
||||
FilterSchema = options["FilterSchema"];
|
||||
FilterXMLSchema = options["FilterXMLSchema"];
|
||||
FilterTableFileGroup = options["FilterTableFileGroup"];
|
||||
FilterExtendedProperties = options["FilterExtendedProperties"];
|
||||
FilterDDLTriggers = options["FilterDDLTriggers"];
|
||||
FilterSynonyms = options["FilterSynonyms"];
|
||||
FilterRules = options["FilterRules"];
|
||||
FilterAssemblies = options["FilterAssemblies"];
|
||||
|
||||
}
|
||||
|
||||
public Boolean FilterTableChangeTracking { get; set; }
|
||||
|
||||
public Boolean FilterTableLockEscalation { get; set; }
|
||||
|
||||
public Boolean FilterFullTextPath { get; set; }
|
||||
|
||||
public Boolean FilterFullText { get; set; }
|
||||
|
||||
public Boolean FilterCLRStoredProcedure { get; set; }
|
||||
|
||||
public Boolean FilterCLRUDT { get; set; }
|
||||
|
||||
public Boolean FilterCLRTrigger { get; set; }
|
||||
|
||||
public Boolean FilterCLRFunction { get; set; }
|
||||
|
||||
public Boolean FilterRoles { get; set; }
|
||||
|
||||
public Boolean FilterUsers { get; set; }
|
||||
|
||||
public Boolean FilterNotForReplication { get; set; }
|
||||
|
||||
public Boolean FilterColumnCollation { get; set; }
|
||||
|
||||
public Boolean FilterColumnIdentity { get; set; }
|
||||
|
||||
public Boolean FilterColumnOrder { get; set; }
|
||||
|
||||
public Boolean FilterIndexRowLock { get; set; }
|
||||
|
||||
public Boolean FilterIndexIncludeColumns { get; set; }
|
||||
|
||||
public Boolean FilterIndexFillFactor { get; set; }
|
||||
|
||||
public Boolean FilterAssemblies { get; set; }
|
||||
|
||||
public Boolean FilterRules { get; set; }
|
||||
|
||||
public Boolean FilterSynonyms { get; set; }
|
||||
|
||||
public Boolean FilterDDLTriggers { get; set; }
|
||||
|
||||
public Boolean FilterExtendedProperties { get; set; }
|
||||
|
||||
public Boolean FilterTableFileGroup { get; set; }
|
||||
|
||||
public Boolean FilterFunction { get; set; }
|
||||
|
||||
public Boolean FilterStoredProcedure { get; set; }
|
||||
|
||||
public Boolean FilterView { get; set; }
|
||||
|
||||
public Boolean FilterTable { get; set; }
|
||||
|
||||
public Boolean FilterTableOption { get; set; }
|
||||
|
||||
public Boolean FilterUserDataType { get; set; }
|
||||
|
||||
public Boolean FilterTrigger { get; set; }
|
||||
|
||||
public Boolean FilterXMLSchema { get; set; }
|
||||
|
||||
public Boolean FilterSchema { get; set; }
|
||||
|
||||
public Boolean FilterConstraint { get; set; }
|
||||
|
||||
public Boolean FilterConstraintCheck { get; set; }
|
||||
|
||||
public Boolean FilterConstraintUK { get; set; }
|
||||
|
||||
public Boolean FilterConstraintFK { get; set; }
|
||||
|
||||
public Boolean FilterConstraintPK { get; set; }
|
||||
|
||||
public Boolean FilterIndex { get; set; }
|
||||
|
||||
public Boolean FilterIndexFilter { get; set; }
|
||||
|
||||
public Boolean FilterPartitionScheme { get; set; }
|
||||
|
||||
public Boolean FilterPartitionFunction { get; set; }
|
||||
|
||||
public IDictionary<string, bool> GetOptions()
|
||||
{
|
||||
|
||||
Dictionary<string, bool> options = new Dictionary<string, bool>();
|
||||
options.Add("FilterPartitionFunction", FilterPartitionFunction);
|
||||
options.Add("FilterPartitionScheme", FilterPartitionScheme);
|
||||
options.Add("FilterIndexFilter", FilterIndexFilter);
|
||||
options.Add("FilterIndex", FilterIndex);
|
||||
options.Add("FilterConstraintPK", FilterConstraintPK);
|
||||
options.Add("FilterConstraintFK", FilterConstraintFK);
|
||||
options.Add("FilterConstraintUK", FilterConstraintUK);
|
||||
options.Add("FilterConstraintCheck", FilterConstraintCheck);
|
||||
options.Add("FilterIndexFillFactor", FilterIndexFillFactor);
|
||||
options.Add("FilterIndexIncludeColumns", FilterIndexIncludeColumns);
|
||||
options.Add("FilterIndexRowLock", FilterIndexRowLock);
|
||||
options.Add("FilterColumnOrder", FilterColumnOrder);
|
||||
options.Add("FilterColumnIdentity", FilterColumnIdentity);
|
||||
options.Add("FilterColumnCollation", FilterColumnCollation);
|
||||
options.Add("FilterNotForReplication", FilterNotForReplication);
|
||||
options.Add("FilterUsers", FilterUsers);
|
||||
options.Add("FilterRoles", FilterRoles);
|
||||
options.Add("FilterCLRFunction", FilterCLRFunction);
|
||||
options.Add("FilterCLRTrigger", FilterCLRTrigger);
|
||||
options.Add("FilterCLRUDT", FilterCLRUDT);
|
||||
options.Add("FilterCLRStoredProcedure", FilterCLRStoredProcedure);
|
||||
options.Add("FilterFullText", FilterFullText);
|
||||
options.Add("FilterFullTextPath", FilterFullTextPath);
|
||||
options.Add("FilterTableLockEscalation", FilterTableLockEscalation);
|
||||
options.Add("FilterTableChangeTracking", FilterTableChangeTracking);
|
||||
options.Add("FilterConstraint", FilterConstraint);
|
||||
options.Add("FilterFunction", FilterFunction);
|
||||
options.Add("FilterStoredProcedure", FilterStoredProcedure);
|
||||
options.Add("FilterView", FilterView);
|
||||
options.Add("FilterTable", FilterTable);
|
||||
options.Add("FilterTableOption", FilterTableOption);
|
||||
options.Add("FilterUserDataType", FilterUserDataType);
|
||||
options.Add("FilterTrigger", FilterTrigger);
|
||||
options.Add("FilterSchema", FilterSchema);
|
||||
options.Add("FilterXMLSchema", FilterXMLSchema);
|
||||
options.Add("FilterTableFileGroup", FilterTableFileGroup);
|
||||
options.Add("FilterExtendedProperties", FilterExtendedProperties);
|
||||
options.Add("FilterDDLTriggers", FilterDDLTriggers);
|
||||
options.Add("FilterSynonyms", FilterSynonyms);
|
||||
options.Add("FilterRules", FilterRules);
|
||||
options.Add("FilterAssemblies", FilterAssemblies);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenDBDiff.Schema.Model;
|
||||
|
||||
namespace OpenDBDiff.Schema.SQLServer.Generates.Options
|
||||
{
|
||||
public class SqlOptionScript : Schema.Model.IOptionsContainer<bool>
|
||||
{
|
||||
private Boolean alterObjectOnSchemaBinding = true;
|
||||
|
||||
public SqlOptionScript()
|
||||
{
|
||||
}
|
||||
|
||||
public SqlOptionScript(IOptionsContainer<bool> optionsContainer)
|
||||
{
|
||||
AlterObjectOnSchemaBinding = optionsContainer.GetOptions()["AlterObjectOnSchemaBinding"];
|
||||
}
|
||||
|
||||
public Boolean AlterObjectOnSchemaBinding
|
||||
{
|
||||
get { return alterObjectOnSchemaBinding; }
|
||||
set { alterObjectOnSchemaBinding = value; }
|
||||
}
|
||||
|
||||
public IDictionary<string, bool> GetOptions()
|
||||
{
|
||||
return new Dictionary<string, bool>() { { "AlterObjectOnSchemaBinding", AlterObjectOnSchemaBinding } };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user