mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04: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:
|
if self.default2String() == new_default_str:
|
||||||
new_default_str = None
|
new_default_str = None
|
||||||
if self.comment == new_comment:
|
if self.comment == new_comment:
|
||||||
# Update also a new_comment
|
|
||||||
new_comment = None
|
new_comment = None
|
||||||
ret = self.table().database().connector.updateTableColumn((self.table().schemaName(), self.table().name),
|
ret = self.table().database().connector.updateTableColumn((self.table().schemaName(), self.table().name),
|
||||||
self.name, new_name, new_type_str,
|
self.name, new_name, new_type_str,
|
||||||
|
@ -71,15 +71,13 @@ class DlgFieldProperties(QDialog, Ui_Dialog):
|
|||||||
fld.notNull = not self.chkNull.isChecked()
|
fld.notNull = not self.chkNull.isChecked()
|
||||||
fld.default = self.editDefault.text()
|
fld.default = self.editDefault.text()
|
||||||
fld.hasDefault = fld.default != ""
|
fld.hasDefault = fld.default != ""
|
||||||
# Get the comment from the LineEdit
|
|
||||||
fld.comment = self.editCom.text()
|
fld.comment = self.editCom.text()
|
||||||
try:
|
# length field also used for geometry definition, so we should
|
||||||
modifier = int(self.editLength.text())
|
# not cast its value to int
|
||||||
except ValueError:
|
if self.editLength.text() != "":
|
||||||
ok = False
|
fld.modifier = self.editLength.text()
|
||||||
else:
|
else:
|
||||||
ok = True
|
fld.modifier = None
|
||||||
fld.modifier = modifier if ok else None
|
|
||||||
return fld
|
return fld
|
||||||
|
|
||||||
def onOK(self):
|
def onOK(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user