- 增加 IndexAttribute 特性,自动迁移索引,以及对应的 FluentApi 方法;

- 移除 ColumnAttribute.Unique 属性设置,改为 IndexAttribute 特性设置唯一键;
This commit is contained in:
28810
2019-10-03 04:31:04 +08:00
parent cb18b74830
commit 78fded3f8e
43 changed files with 1010 additions and 607 deletions

View 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; }
}
}

View File

@ -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; }