[feat] 增加配置开关CheckDuplicateIndex,是否检查索引重复

This commit is contained in:
智能大石头 2025-04-15 09:48:36 +08:00
parent f2a1032941
commit e5c205d804
2 changed files with 5 additions and 1 deletions

View File

@ -253,7 +253,7 @@ public class TableItem
}
// 检查索引重复,最左原则
for (var i = 0; i < table.Indexes.Count; i++)
for (var i = 0; i < table.Indexes.Count && XCodeSetting.Current.CheckDuplicateIndex; i++)
{
var di = table.Indexes[i];
for (var j = i + 1; j < table.Indexes.Count; j++)

View File

@ -73,6 +73,10 @@ public class XCodeSetting : Config<XCodeSetting>
[Description("反向工程。Off 关闭ReadOnly 只读不执行On 打开仅新建Full 完全,修改删除")]
public Migration Migration { get; set; } = Migration.On;
/// <summary>是否检查索引重复。默认打开</summary>
[Description("检查索引重复。默认打开")]
public Boolean CheckDuplicateIndex { get; set; } = true;
/// <summary></summary>
[Description("表名称、字段名大小写格式。Default 默认(由数据库决定);None 与模型保持一致;Upper 全大写;Lower 全小写;Underline下划线")]
public NameFormats NameFormat { get; set; } = NameFormats.Default;