From 5e256922e64dc9222da2d6810c2429d7e06b8c13 Mon Sep 17 00:00:00 2001 From: dailyccc <963922242@qq.com> Date: Sun, 5 Mar 2023 00:32:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20QuestDb=20CodeFirs?= =?UTF-8?q?t=20AutoSubtableAttribute/ColumnAttribute=E5=88=A4=E6=96=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs index 52e499c5..d3f51144 100644 --- a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs +++ b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs @@ -181,7 +181,11 @@ namespace FreeSql.QuestDb var timeAttr = propety.GetCustomAttribute(); if (timeAttr != null) { - var colName = tb.Columns.FirstOrDefault(it => it.Key == propety.Name).Value; + var ckey = propety.Name; + var colNameAttr = propety.GetCustomAttribute(); + if (!string.IsNullOrWhiteSpace(colNameAttr?.Name)) + ckey = colNameAttr.Name; + var colName = tb.Columns.FirstOrDefault(it => it.Key == ckey).Value; sbalter.Append( $" TIMESTAMP({colName.Attribute.Name}) PARTITION BY {timeAttr.SubtableType};{Environment.NewLine}"); } From 2d16aec7c5ef48071768cd068ce3d44d3efa65af Mon Sep 17 00:00:00 2001 From: dailyccc <963922242@qq.com> Date: Sun, 5 Mar 2023 00:34:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20QuestDb=20CodeFirs?= =?UTF-8?q?t=20AutoSubtableAttribute/ColumnAttribute=E5=88=A4=E6=96=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs index d3f51144..f375410d 100644 --- a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs +++ b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs @@ -182,8 +182,10 @@ namespace FreeSql.QuestDb if (timeAttr != null) { var ckey = propety.Name; + //如果存在Column.Name var colNameAttr = propety.GetCustomAttribute(); if (!string.IsNullOrWhiteSpace(colNameAttr?.Name)) + //则以Column中的Name为主 ckey = colNameAttr.Name; var colName = tb.Columns.FirstOrDefault(it => it.Key == ckey).Value; sbalter.Append(