Merge origin/dev-v7.6 into dev-v8-zbwip (builds, not tested)
This commit is contained in:
@@ -7,7 +7,7 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an SqlSyntaxProvider for Sql Server
|
||||
/// Represents an SqlSyntaxProvider for Sql Server.
|
||||
/// </summary>
|
||||
[SqlSyntaxProvider(Constants.DbProviderNames.SqlServer)]
|
||||
public class SqlServerSyntaxProvider : MicrosoftSqlSyntaxProviderBase<SqlServerSyntaxProvider>
|
||||
@@ -38,6 +38,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
V2008 = 4,
|
||||
V2012 = 5,
|
||||
V2014 = 6,
|
||||
V2016 = 7,
|
||||
Other = 99
|
||||
}
|
||||
|
||||
@@ -70,6 +71,9 @@ namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
case "??":
|
||||
ProductVersionName = VersionName.Invalid;
|
||||
break;
|
||||
case "13":
|
||||
ProductVersionName = VersionName.V2016;
|
||||
break;
|
||||
case "12":
|
||||
ProductVersionName = VersionName.V2014;
|
||||
break;
|
||||
@@ -136,7 +140,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
{
|
||||
var items = db.Fetch<dynamic>("SELECT TableName = t.Name,ColumnName = c.Name,dc.Name,dc.[Definition] FROM sys.tables t INNER JOIN sys.default_constraints dc ON t.object_id = dc.parent_object_id INNER JOIN sys.columns c ON dc.parent_object_id = c.object_id AND c.column_id = dc.parent_column_id");
|
||||
return items.Select(x => new Tuple<string, string, string, string>(x.TableName, x.ColumnName, x.Name, x.Definition));
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<string> GetTablesInSchema(Database db)
|
||||
{
|
||||
@@ -181,9 +185,9 @@ from sys.tables as T inner join sys.indexes as I on T.[object_id] = I.[object_id
|
||||
inner join sys.all_columns as AC on IC.[object_id] = AC.[object_id] and IC.[column_id] = AC.[column_id]
|
||||
WHERE I.name NOT LIKE 'PK_%'
|
||||
order by T.name, I.name");
|
||||
return items.Select(item => new Tuple<string, string, string, bool>(item.TABLE_NAME, item.INDEX_NAME, item.COLUMN_NAME,
|
||||
return items.Select(item => new Tuple<string, string, string, bool>(item.TABLE_NAME, item.INDEX_NAME, item.COLUMN_NAME,
|
||||
item.UNIQUE == 1)).ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override bool DoesTableExist(Database db, string tableName)
|
||||
@@ -225,7 +229,7 @@ order by T.name, I.name");
|
||||
switch (systemMethod)
|
||||
{
|
||||
case SystemMethods.NewGuid:
|
||||
return "NEWID()";
|
||||
return "NEWID()";
|
||||
case SystemMethods.CurrentDateTime:
|
||||
return "GETDATE()";
|
||||
//case SystemMethods.NewSequentialId:
|
||||
@@ -239,7 +243,6 @@ order by T.name, I.name");
|
||||
|
||||
public override string DeleteDefaultConstraint => "ALTER TABLE [{0}] DROP CONSTRAINT [DF_{0}_{1}]";
|
||||
|
||||
|
||||
public override string DropIndex => "DROP INDEX {0} ON {1}";
|
||||
|
||||
public override string RenameColumn => "sp_rename '{0}.{1}', '{2}', 'COLUMN'";
|
||||
|
||||
Reference in New Issue
Block a user