- 修复 Oracle Dbfirst 字段可空、和主键判断的 bug;

This commit is contained in:
28810
2019-12-12 18:03:32 +08:00
parent a9512745d8
commit 801b9ba082
3 changed files with 183 additions and 163 deletions

View File

@ -276,8 +276,8 @@ where a.owner in ({1}) and {0}
ds2item[1] = row[1];
ds2item[2] = Regex.Replace(string.Concat(row[2]), @"\(\d+\)", "");
ds2item[4] = OracleCodeFirst.GetOracleSqlTypeFullName(new object[] { row[1], row[2], row[3], row[4], row[5], row[6] });
ds2item[5] = string.Concat(row[7]) == "1";
ds2item[6] = string.Concat(row[8]) == "1";
ds2item[5] = string.Concat(row[7]);
ds2item[6] = string.Concat(row[8]);
ds2item[7] = string.Concat(row[9]);
ds2.Add(ds2item);
}
@ -321,7 +321,7 @@ a.table_owner || '.' || a.table_name,
nvl(freesql_long_2_varchar(a.index_name, c.table_name, c.column_position), 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
@ -331,7 +331,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 constraint_name = a.index_name and constraint_type = 'P')
", loc8, databaseIn);
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
if (ds == null) return loc1;
@ -352,6 +351,7 @@ and not exists(select 1 from all_constraints where constraint_name = a.index_nam
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<string, DbIndexInfo> loc10 = null;
DbIndexInfo loc11 = null;