mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[dbmanager] don't ignore field modifiers (e.g. length or geometry
definition) when updating it (fix #27613)
This commit is contained in:
parent
2a29c152a9
commit
cebdc8dded
@ -1179,7 +1179,6 @@ class TableField(TableSubItemObject):
|
||||
if self.default2String() == new_default_str:
|
||||
new_default_str = None
|
||||
if self.comment == new_comment:
|
||||
# Update also a new_comment
|
||||
new_comment = None
|
||||
ret = self.table().database().connector.updateTableColumn((self.table().schemaName(), self.table().name),
|
||||
self.name, new_name, new_type_str,
|
||||
|
@ -71,15 +71,13 @@ class DlgFieldProperties(QDialog, Ui_Dialog):
|
||||
fld.notNull = not self.chkNull.isChecked()
|
||||
fld.default = self.editDefault.text()
|
||||
fld.hasDefault = fld.default != ""
|
||||
# Get the comment from the LineEdit
|
||||
fld.comment = self.editCom.text()
|
||||
try:
|
||||
modifier = int(self.editLength.text())
|
||||
except ValueError:
|
||||
ok = False
|
||||
# length field also used for geometry definition, so we should
|
||||
# not cast its value to int
|
||||
if self.editLength.text() != "":
|
||||
fld.modifier = self.editLength.text()
|
||||
else:
|
||||
ok = True
|
||||
fld.modifier = modifier if ok else None
|
||||
fld.modifier = None
|
||||
return fld
|
||||
|
||||
def onOK(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user