Skip to content

Commit 3ea533a

Browse files
committed
- 修复 pgsql DbFirst 未正确获取 Position 值;#1154
1 parent 0db2b8f commit 3ea533a

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

Providers/FreeSql.Provider.KingbaseES/KingbaseESDbFirst.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ from sys_class c
258258
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
259259
if (ds == null) return loc1;
260260

261-
var position = 0;
262261
foreach (object[] row in ds)
263262
{
264263
var object_id = string.Concat(row[0]);
@@ -308,7 +307,7 @@ from sys_class c
308307
Table = loc2[object_id],
309308
Comment = comment,
310309
DefaultValue = defaultValue,
311-
Position = ++position
310+
Position = attnum
312311
});
313312
loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
314313
loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);

Providers/FreeSql.Provider.Odbc/KingbaseES/OdbcKingbaseESDbFirst.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ from sys_class c
259259
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
260260
if (ds == null) return loc1;
261261

262-
var position = 0;
263262
foreach (object[] row in ds)
264263
{
265264
var object_id = string.Concat(row[0]);
@@ -309,7 +308,7 @@ from sys_class c
309308
Table = loc2[object_id],
310309
Comment = comment,
311310
DefaultValue = defaultValue,
312-
Position = ++position
311+
Position = attnum
313312
});
314313
loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
315314
loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);

Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLDbFirst.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ from pg_class c
273273
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
274274
if (ds == null) return loc1;
275275

276-
var position = 0;
277276
foreach (object[] row in ds)
278277
{
279278
var object_id = string.Concat(row[0]);
@@ -324,7 +323,7 @@ from pg_class c
324323
Table = loc2[object_id],
325324
Comment = comment,
326325
DefaultValue = defaultValue,
327-
Position = ++position
326+
Position = attnum
328327
});
329328
loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
330329
loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);

Providers/FreeSql.Provider.PostgreSQL/PostgreSQLDbFirst.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ from pg_class c
381381
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
382382
if (ds == null) return loc1;
383383

384-
var position = 0;
385384
foreach (object[] row in ds)
386385
{
387386
var object_id = string.Concat(row[0]);
@@ -432,7 +431,7 @@ from pg_class c
432431
Table = loc2[object_id],
433432
Comment = comment,
434433
DefaultValue = defaultValue,
435-
Position = ++position
434+
Position = attnum
436435
});
437436
loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
438437
loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);

Providers/FreeSql.Provider.ShenTong/ShenTongDbFirst.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ from sys_class c
277277
ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
278278
if (ds == null) return loc1;
279279

280-
var position = 0;
281280
foreach (object[] row in ds)
282281
{
283282
var object_id = string.Concat(row[0]);
@@ -327,7 +326,7 @@ from sys_class c
327326
Table = loc2[object_id],
328327
Comment = comment,
329328
DefaultValue = defaultValue,
330-
Position = ++position
329+
Position = attnum
331330
});
332331
loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
333332
loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);

0 commit comments

Comments
 (0)