diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs index fe22d59fa6..b41caee9a3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs @@ -94,7 +94,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table // for this, but I don't see another way around. MySQL doesn't support checking for a constraint before creating // it... except in a very strange way but it doesn't actually provider error feedback if it doesn't work so we cannot use // it. For now, this is what I'm doing - if (Expression.CurrentDatabaseProvider == DatabaseProviders.MySql) + if (Expression.CurrentDatabaseProvider != DatabaseProviders.MySql) { var expression = new CreateConstraintExpression(ConstraintType.PrimaryKey) { @@ -123,7 +123,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table // it... except in a very strange way but it doesn't actually provider error feedback if it doesn't work so we cannot use // it. For now, this is what I'm doing - if (Expression.CurrentDatabaseProvider == DatabaseProviders.MySql) + if (Expression.CurrentDatabaseProvider != DatabaseProviders.MySql) { var expression = new CreateConstraintExpression(ConstraintType.PrimaryKey) { diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs index f8e423699c..b44104a5f1 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs @@ -457,9 +457,9 @@ namespace Umbraco.Core.Persistence.SqlSyntax if (column.DefaultValue == null) return string.Empty; - // TODO: Actually use the SystemMethods on the DTO. For now I've put a hack in to catch getdate(), not using the others at the moment + //hack - probably not needed with latest changes if (column.DefaultValue.ToString().ToLower().Equals("getdate()".ToLower())) - return string.Format(DefaultValueFormat, column.DefaultValue); + column.DefaultValue = SystemMethods.CurrentDateTime; // see if this is for a system method if (column.DefaultValue is SystemMethods)