Update mysql codefirst time default value

This commit is contained in:
sunkaixuan
2022-03-03 15:16:57 +08:00
parent e29f2c6f3b
commit 70ac668407
2 changed files with 19 additions and 1 deletions

View File

@@ -22,6 +22,10 @@ namespace OrmTest
IsAutoCloseConnection = true
});
ssc.Aop.OnLogExecuting = (s, p) =>
{
Console.WriteLine(s);
};
ssc.CodeFirst.InitTables<Student>();
var expMethods = new List<SqlFuncExternal>();
@@ -75,9 +79,22 @@ namespace OrmTest
}
ssc.CodeFirst.InitTables<unittest1231sdaa>();
ssc.CodeFirst.InitTables<unittest1231sdaa2>();
}
}
public class unittest1231sdaa
{
[SugarColumn(IndexGroupNameList = new string[] { "index3" }, ColumnDataType = "DATETIME(6)", DefaultValue = "CURRENT_TIMESTAMP(6)")]
public DateTime update_time { get; set; }
}
public class unittest1231sdaa2
{
[SugarColumn(IndexGroupNameList = new string[] { "index3" }, ColumnDataType = "DATETIME", DefaultValue = "CURRENT_TIMESTAMP")]
public DateTime update_time { get; set; }
}
[SugarTable("unitstudent1111")]
public class Student
{