mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 10:10:16 +08:00
MySql codefirst collate
This commit is contained in:
parent
2a0e91d4ec
commit
50f5cfa166
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user