mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 04:13:48 +08:00
Synchronization code
This commit is contained in:
parent
aba7da92b9
commit
e67860e0af
@ -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;
|
||||
|
@ -372,7 +372,7 @@ WHERE EVENT_OBJECT_TABLE = '"+tableName+"'");
|
||||
public override bool CreateDatabase(string databaseName, string databaseDirectory = null)
|
||||
{
|
||||
|
||||
if (this.Context.Ado.IsValidConnection())
|
||||
if (this.Context.Ado.IsValidConnection())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -415,6 +415,17 @@ WHERE EVENT_OBJECT_TABLE = '"+tableName+"'");
|
||||
{
|
||||
createSql = createSql.Replace("utf8 COLLATE utf8_general_ci", "utf8mb4");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(StaticConfig.CodeFirst_MySqlCollate))
|
||||
{
|
||||
if (createSql.Contains(" COLLATE "))
|
||||
{
|
||||
createSql = $" {Regex.Split(createSql, " COLLATE ").First()} COLLATE {StaticConfig.CodeFirst_MySqlCollate} ";
|
||||
}
|
||||
else
|
||||
{
|
||||
createSql += $" COLLATE {StaticConfig.CodeFirst_MySqlCollate} ";
|
||||
}
|
||||
}
|
||||
newDb.Ado.ExecuteCommand(string.Format(createSql, databaseName, databaseDirectory));
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user