Fixes: U4-7090 Upgrade error with dates

This commit is contained in:
Shannon
2015-09-11 11:49:37 +02:00
parent 647c7a6ce0
commit 4bb89c1827
4 changed files with 33 additions and 0 deletions

View File

@@ -191,6 +191,21 @@ ORDER BY TABLE_NAME, INDEX_NAME",
return false;
}
/// <summary>
/// This is used ONLY if we need to format datetime without using SQL parameters (i.e. during migrations)
/// </summary>
/// <param name="date"></param>
/// <param name="includeTime"></param>
/// <returns></returns>
/// <remarks>
/// MySQL has a DateTime standard that is unambiguous and works on all servers:
/// YYYYMMDDHHMMSS
/// </remarks>
public override string FormatDateTime(DateTime date, bool includeTime = true)
{
return includeTime ? date.ToString("YYYYMMDDHHmmss") : date.ToString("YYYYMMDD");
}
public override string GetQuotedTableName(string tableName)
{
return string.Format("`{0}`", tableName);