From 55dbce3a93464ae95500e68c1012fbc3007b2f85 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 2 Jan 2013 11:49:57 -0100 Subject: [PATCH] Okay, really fixed the getdate() problem now. Maybe.. I should.. You know.. build my code first before I test it! D'oh. --- .../Persistence/SqlSyntax/SqlSyntaxProviderBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs index c826d640f1..0f6f832c66 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs @@ -357,9 +357,12 @@ namespace Umbraco.Core.Persistence.SqlSyntax if (column.DefaultValue == null) return string.Empty; - // see if this is for a system method // 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 - if (column.DefaultValue is SystemMethods || column.DefaultValue.ToString().ToLower().Equals("getdate()".ToLower())) + if (column.DefaultValue.ToString().ToLower().Equals("getdate()".ToLower())) + return string.Format(DefaultValueFormat, column.DefaultValue); + + // see if this is for a system method + if (column.DefaultValue is SystemMethods) { string method = FormatSystemMethods((SystemMethods)column.DefaultValue); if (string.IsNullOrEmpty(method))