- 修复ClickHouse CodeFirst 多主键问题

This commit is contained in:
d4ilys
2023-08-17 14:38:42 +08:00
parent c9aa3353fb
commit eec10f89b0
2 changed files with 133 additions and 6 deletions

View File

@ -23,5 +23,126 @@ namespace FreeSql.Tests.ClickHouse
{
fsql.CodeFirst.SyncStructure(typeof(CollectDataEntityUpdate01));
}
[Fact]
public void Issuse1587Test()
{
fsql.CodeFirst.SyncStructure(typeof(PositionInfoModel));
}
[Fact]
public void Issuse1587TestOnePrimary()
{
fsql.CodeFirst.SyncStructure(typeof(PositionInfoModel2));
}
}
[Table(Name = "table_1")]
[Index("stcd_index", "STCD", false)]
[Index("tm_index", "TM", false)]
[Index("type_index", "TYPE", false)]
public class PositionInfoModel
{
[Column(IsPrimary = true)]
public string STCD
{
set; get;
}
[Column(IsPrimary = true)]
public DateTime TM
{
set; get;
}
[Column(IsNullable = false)]
public decimal LON
{
set; get;
}
[Column(IsNullable = false)]
public decimal LAT
{
set; get;
}
[Column(IsNullable = false)]
public int TYPE
{
set; get;
}
[Column(IsNullable = true)]
public decimal SPD
{
set; get;
}
[Column(IsNullable = true)]
public decimal COG
{
set; get;
}
[Column(IsNullable = true)]
public DateTime? UT
{
set; get;
}
}
[Table(Name = "table_2")]
[Index("stcd_index", "STCD", false)]
[Index("tm_index", "TM", false)]
[Index("type_index", "TYPE", false)]
public class PositionInfoModel2
{
public string STCD
{
set; get;
}
[Column(IsPrimary = true)]
public DateTime TM
{
set; get;
}
[Column(IsNullable = false)]
public decimal LON
{
set; get;
}
[Column(IsNullable = false)]
public decimal LAT
{
set; get;
}
[Column(IsNullable = false)]
public int TYPE
{
set; get;
}
[Column(IsNullable = true)]
public decimal SPD
{
set; get;
}
[Column(IsNullable = true)]
public decimal COG
{
set; get;
}
[Column(IsNullable = true)]
public DateTime? UT
{
set; get;
}
}
}