[dbmanager] don't ignore field modifiers (e.g. length or geometry

definition) when updating it (fix #27613)
This commit is contained in:
Alexander Bruy 2019-09-22 14:10:56 +03:00 committed by Nyall Dawson
parent 2a29c152a9
commit cebdc8dded
2 changed files with 5 additions and 8 deletions

View File

@ -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,

View File

@ -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):