mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 修复 pgsql DbFirst 未正确获取 Position 值;#1154
This commit is contained in:
		@@ -258,7 +258,6 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
					                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
				
			||||||
                if (ds == null) return loc1;
 | 
					                if (ds == null) return loc1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var position = 0;
 | 
					 | 
				
			||||||
                foreach (object[] row in ds)
 | 
					                foreach (object[] row in ds)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var object_id = string.Concat(row[0]);
 | 
					                    var object_id = string.Concat(row[0]);
 | 
				
			||||||
@@ -308,7 +307,7 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                        Table = loc2[object_id],
 | 
					                        Table = loc2[object_id],
 | 
				
			||||||
                        Comment = comment,
 | 
					                        Comment = comment,
 | 
				
			||||||
                        DefaultValue = defaultValue,
 | 
					                        DefaultValue = defaultValue,
 | 
				
			||||||
                        Position = ++position
 | 
					                        Position = attnum
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
				
			||||||
                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -259,7 +259,6 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
					                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
				
			||||||
                if (ds == null) return loc1;
 | 
					                if (ds == null) return loc1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var position = 0;
 | 
					 | 
				
			||||||
                foreach (object[] row in ds)
 | 
					                foreach (object[] row in ds)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var object_id = string.Concat(row[0]);
 | 
					                    var object_id = string.Concat(row[0]);
 | 
				
			||||||
@@ -309,7 +308,7 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                        Table = loc2[object_id],
 | 
					                        Table = loc2[object_id],
 | 
				
			||||||
                        Comment = comment,
 | 
					                        Comment = comment,
 | 
				
			||||||
                        DefaultValue = defaultValue,
 | 
					                        DefaultValue = defaultValue,
 | 
				
			||||||
                        Position = ++position
 | 
					                        Position = attnum
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
				
			||||||
                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -273,7 +273,6 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
					                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
				
			||||||
                if (ds == null) return loc1;
 | 
					                if (ds == null) return loc1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var position = 0;
 | 
					 | 
				
			||||||
                foreach (object[] row in ds)
 | 
					                foreach (object[] row in ds)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var object_id = string.Concat(row[0]);
 | 
					                    var object_id = string.Concat(row[0]);
 | 
				
			||||||
@@ -324,7 +323,7 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                        Table = loc2[object_id],
 | 
					                        Table = loc2[object_id],
 | 
				
			||||||
                        Comment = comment,
 | 
					                        Comment = comment,
 | 
				
			||||||
                        DefaultValue = defaultValue,
 | 
					                        DefaultValue = defaultValue,
 | 
				
			||||||
                        Position = ++position
 | 
					                        Position = attnum
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
				
			||||||
                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -381,7 +381,6 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
					                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
				
			||||||
                if (ds == null) return loc1;
 | 
					                if (ds == null) return loc1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var position = 0;
 | 
					 | 
				
			||||||
                foreach (object[] row in ds)
 | 
					                foreach (object[] row in ds)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var object_id = string.Concat(row[0]);
 | 
					                    var object_id = string.Concat(row[0]);
 | 
				
			||||||
@@ -432,7 +431,7 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                        Table = loc2[object_id],
 | 
					                        Table = loc2[object_id],
 | 
				
			||||||
                        Comment = comment,
 | 
					                        Comment = comment,
 | 
				
			||||||
                        DefaultValue = defaultValue,
 | 
					                        DefaultValue = defaultValue,
 | 
				
			||||||
                        Position = ++position
 | 
					                        Position = attnum
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
				
			||||||
                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -277,7 +277,6 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
					                ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
 | 
				
			||||||
                if (ds == null) return loc1;
 | 
					                if (ds == null) return loc1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var position = 0;
 | 
					 | 
				
			||||||
                foreach (object[] row in ds)
 | 
					                foreach (object[] row in ds)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var object_id = string.Concat(row[0]);
 | 
					                    var object_id = string.Concat(row[0]);
 | 
				
			||||||
@@ -327,7 +326,7 @@ where {loc8.ToString().Replace("a.table_name", "ns.nspname || '.' || c.relname")
 | 
				
			|||||||
                        Table = loc2[object_id],
 | 
					                        Table = loc2[object_id],
 | 
				
			||||||
                        Comment = comment,
 | 
					                        Comment = comment,
 | 
				
			||||||
                        DefaultValue = defaultValue,
 | 
					                        DefaultValue = defaultValue,
 | 
				
			||||||
                        Position = ++position
 | 
					                        Position = attnum
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].DbType = this.GetDbType(loc3[object_id][column]);
 | 
				
			||||||
                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
					                    loc3[object_id][column].CsType = this.GetCsTypeInfo(loc3[object_id][column]);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user