mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
MySql codefirst collate
This commit is contained in:
@@ -9,11 +9,13 @@ namespace SqlSugar
|
||||
public class StaticConfig
|
||||
{
|
||||
public static bool EnableAot { get; set; }
|
||||
public static Func<string,string> Encode { get; set; }
|
||||
public static Func<string,string> Decode{ get; set; }
|
||||
public static bool AppContext_ConvertInfinityDateTime { get; set; }
|
||||
public static Func<string, string> Encode { get; set; }
|
||||
public static Func<string, string> Decode { get; set; }
|
||||
public static bool AppContext_ConvertInfinityDateTime { get; set; }
|
||||
|
||||
public const string CodeFirst_BigString = "varcharmax,longtext,text,clob";
|
||||
public static string CodeFirst_MySqlCollate{get;set;}
|
||||
|
||||
public static Func<long> CustomSnowFlakeFunc;
|
||||
public static Func<long> CustomSnowFlakeTimeErrorFunc;
|
||||
public static Func<Guid> CustomGuidFunc;
|
||||
|
@@ -415,6 +415,10 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'");
|
||||
{
|
||||
createSql = createSql.Replace("utf8 COLLATE utf8_general_ci", "utf8mb4");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(StaticConfig.CodeFirst_MySqlCollate))
|
||||
{
|
||||
createSql += $" COLLATE {StaticConfig.CodeFirst_MySqlCollate} ";
|
||||
}
|
||||
newDb.Ado.ExecuteCommand(string.Format(createSql, databaseName, databaseDirectory));
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user