update

28810
2019-10-03 04:34:01 +08:00
parent ba9d38261b
commit 381a241f68
2 changed files with 12 additions and 10 deletions

@@ -27,27 +27,24 @@ class Topic {
* 当没有指明主键时,标记自增的成员将成为主键;
## 唯一键(Unique Key)
## 唯一键(Unique Key)、索引Index
```csharp
class AddUniquesInfo {
[Index("uk_phone", "phone", true)]
[Index("uk_group_index", "group,index", true)]
[Index("uk_group_index22", "group, index22 desc", true)]
class AddUniquesInfo
{
public Guid id { get; set; }
[Column(Unique = "uk_phone")]
public string phone { get; set; }
[Column(Unique = "uk_group_index, uk_group_index22")]
public string group { get; set; }
[Column(Unique = "uk_group_index")]
public int index { get; set; }
[Column(Unique = "uk_group_index22")]
public string index22 { get; set; }
}
```
唯一键,在多个属性指定相同的标识,代表联合键;可使用逗号分割多个 UniqueKey 名
> 第三个参数 true 的时候是唯一键false 的时候是普通索引
## 数据库类型(DbType)

@@ -1,6 +1,11 @@
完整版本:年数-月-日-当日版本号FreeSql、FreeSql.Repository、FreeSql.DbContext 版本号相同。
## v0.10.7
- 增加 IndexAttribute 特性,自动迁移索引,以及对应的 FluentApi 方法;
- 移除 ColumnAttribute.Unique 属性设置,改为 IndexAttribute 特性设置唯一键;
## v0.10.6
- 优化 DbContext/Repository ManyToMany联级保存功能当是新增数据时不查询中间表记录对比差异直接插入