diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs index 4d2df7c25..03c7e3d47 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/CodeFirstProvider/CodeFirstProvider.cs @@ -222,6 +222,10 @@ namespace SqlSugar { foreach (var item in entityInfo.Indexs) { + if (entityInfo.Type.GetCustomAttribute() != null) + { + item.IndexName = item.IndexName + entityInfo.DbTableName; + } if (!this.Context.DbMaintenance.IsAnyIndex(item.IndexName)) { var fileds = item.IndexFields