mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 增加 IndexAttribute 特性,自动迁移索引,以及对应的 FluentApi 方法;
- 移除 ColumnAttribute.Unique 属性设置,改为 IndexAttribute 特性设置唯一键;
This commit is contained in:
21
FreeSql/Internal/Model/IndexInfo.cs
Normal file
21
FreeSql/Internal/Model/IndexInfo.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace FreeSql.Internal.Model
|
||||
{
|
||||
public class IndexInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public IndexColumnInfo[] Columns { get; set; }
|
||||
public bool IsUnique { get; set; }
|
||||
}
|
||||
|
||||
public class IndexColumnInfo
|
||||
{
|
||||
public ColumnInfo Column { get; set; }
|
||||
public bool IsDesc { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
@ -16,7 +17,7 @@ namespace FreeSql.Internal.Model
|
||||
public Dictionary<string, ColumnInfo> ColumnsByCsIgnore { get; set; } = new Dictionary<string, ColumnInfo>(StringComparer.CurrentCultureIgnoreCase);
|
||||
public ColumnInfo[] ColumnsByPosition { get; set; }
|
||||
public ColumnInfo[] Primarys { get; set; }
|
||||
public Dictionary<string, List<ColumnInfo>> Uniques { get; set; }
|
||||
public IndexInfo[] Indexes { get; set; }
|
||||
public string CsName { get; set; }
|
||||
public string DbName { get; set; }
|
||||
public string DbOldName { get; set; }
|
||||
|
Reference in New Issue
Block a user