diff --git a/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs b/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs index ab92b7f92..6873c95fb 100644 --- a/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs @@ -13,6 +13,7 @@ namespace OrmTest if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false)) Db.DbMaintenance.DropTable("UnitCodeTest1"); Db.CodeFirst.InitTables(); + Db.CodeFirst.InitTables(); } public class UnitCodeTest1 { @@ -21,5 +22,19 @@ namespace OrmTest [SqlSugar.SugarColumn(DefaultValue="now()", IndexGroupNameList =new string[] {"group1" } )] public DateTime? CreateDate { get; set; } } + [SqlSugar.SugarIndex("UCTINDEX", + nameof(UnitCodeTest111.CreateDate),SqlSugar.OrderByType.Desc, + nameof(UnitCodeTest111.CreateDate2), SqlSugar.OrderByType.Desc, + nameof(UnitCodeTest111.CreateDate3), SqlSugar.OrderByType.Desc + )] + public class UnitCodeTest111 + { + + public int Id { get; set; } + + public DateTime? CreateDate { get; set; } + public DateTime? CreateDate2 { get; set; } + public DateTime? CreateDate3 { get; set; } + } } }