fix broken migration abstraction, fixes restart after upgrade so the runtimestate is correct, fixes sql alter column migration to actually run if its nullable.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
@@ -357,7 +357,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.SqlSyntax
|
||||
sql.Append(" ");
|
||||
sql.Append(FormatIdentity(column));
|
||||
|
||||
var isNullable = column.IsNullable;
|
||||
//var isNullable = column.IsNullable;
|
||||
|
||||
//var constraint = FormatConstraint(column)?.TrimStart("CONSTRAINT ");
|
||||
//var hasConstraint = !string.IsNullOrWhiteSpace(constraint);
|
||||
@@ -365,11 +365,14 @@ namespace Umbraco.Cms.Infrastructure.Persistence.SqlSyntax
|
||||
//var defaultValue = FormatDefaultValue(column);
|
||||
//var hasDefaultValue = !string.IsNullOrWhiteSpace(defaultValue);
|
||||
|
||||
if (isNullable /*&& !hasConstraint && !hasDefaultValue*/)
|
||||
{
|
||||
sqls = Enumerable.Empty<string>();
|
||||
return sql.ToString();
|
||||
}
|
||||
// TODO: This used to exit if nullable but that means this would never work
|
||||
// to return SQL if the column was nullable?!? I don't get it. This was here
|
||||
// 4 years ago, I've removed it so that this works for nullable columns.
|
||||
//if (isNullable /*&& !hasConstraint && !hasDefaultValue*/)
|
||||
//{
|
||||
// sqls = Enumerable.Empty<string>();
|
||||
// return sql.ToString();
|
||||
//}
|
||||
|
||||
var msql = new List<string>();
|
||||
sqls = msql;
|
||||
|
||||
Reference in New Issue
Block a user