mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[db_manager] apply comment to the correct column when altering table
column (fix #21425)
This commit is contained in:
parent
1802c529de
commit
03abf0e42b
@ -922,7 +922,8 @@ class PostGisDBConnector(DBConnector):
|
||||
# comment the column
|
||||
if comment is not None:
|
||||
schema, tablename = self.getSchemaTableName(table)
|
||||
sql = u"COMMENT ON COLUMN %s.%s.%s is '%s'" % (schema, tablename, column, comment)
|
||||
column_name = new_name if new_name is not None and new_name != column else column
|
||||
sql = u"COMMENT ON COLUMN %s.%s.%s IS '%s'" % (schema, tablename, column_name, comment)
|
||||
self._execute(c, sql)
|
||||
|
||||
self._commit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user