From 2b85e2e22d5ae67cce98550f90319c1d5f23aed6 Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Fri, 13 Dec 2019 12:38:57 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E6=9B=B4=E6=96=B0=20=E8=BE=BE=E6=A2=A6=20n?= =?UTF-8?q?ullable=20=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql.DbContext/FreeSql.DbContext.xml | 7 +++++++ .../FreeSql.Provider.Odbc/Dameng/OdbcDamengCodeFirst.cs | 2 +- .../FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml index dc0203b8..d9f91124 100644 --- a/FreeSql.DbContext/FreeSql.DbContext.xml +++ b/FreeSql.DbContext/FreeSql.DbContext.xml @@ -110,6 +110,13 @@ 清空状态数据 + + + 根据 lambda 条件删除数据 + + + + 添加 diff --git a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengCodeFirst.cs b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengCodeFirst.cs index 2891a2b2..99d486fd 100644 --- a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengCodeFirst.cs +++ b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengCodeFirst.cs @@ -182,7 +182,7 @@ a.data_length, a.data_precision, a.data_scale, a.char_used, -case when a.nullable = 'Y' then 1 else 0 end, +case when a.nullable = 'N' then 0 else 1 end, nvl((select 1 from user_sequences where sequence_name='{Utils.GetCsName((tboldname ?? tbname).Last())}_seq_'||a.column_name), 0), nvl((select 1 from user_triggers where trigger_name='{Utils.GetCsName((tboldname ?? tbname).Last())}_seq_'||a.column_name||'TI'), 0), b.comments diff --git a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs index 861dbbdc..3fb77c3f 100644 --- a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs +++ b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengDbFirst.cs @@ -258,7 +258,7 @@ a.data_length, a.data_precision, a.data_scale, a.char_used, -case when a.nullable = 'Y' then 1 else 0 end, +case when a.nullable = 'N' then 0 else 1 end, nvl((select 1 from user_sequences where upper(sequence_name)=upper(a.table_name||'_seq_'||a.column_name)), 0), b.comments from all_tab_cols a @@ -320,7 +320,7 @@ a.table_owner || '.' || a.table_name, c.column_name, c.index_name, case when a.uniqueness = 'UNIQUE' then 1 else 0 end, -0, +case when exists(select 1 from all_constraints where constraint_name = a.index_name and constraint_type = 'P') then 1 else 0 end, 0, case when c.descend = 'DESC' then 1 else 0 end, c.column_position @@ -330,7 +330,6 @@ where a.index_name = c.index_name and a.table_owner = c.table_owner and a.table_name = c.table_name and a.table_owner in ({1}) and {0} -and not exists(select 1 from all_constraints where index_name = a.index_name and constraint_type = 'P') ", loc8, databaseIn); ds = _orm.Ado.ExecuteArray(CommandType.Text, sql); if (ds == null) return loc1; @@ -351,6 +350,7 @@ and not exists(select 1 from all_constraints where index_name = a.index_name and if (loc3.ContainsKey(table_id) == false || loc3[table_id].ContainsKey(column) == false) continue; var loc9 = loc3[table_id][column]; if (loc9.IsPrimary == false && is_primary_key) loc9.IsPrimary = is_primary_key; + if (is_primary_key) continue; Dictionary loc10 = null; DbIndexInfo loc11 = null;