Use UPDATE instead of DELETE and INSERT
This commit is contained in:
parent
b26b34fba9
commit
ac86c415a7
@ -567,10 +567,11 @@ class DBAPI(DbGeneric):
|
|||||||
[name])
|
[name])
|
||||||
row = self.dbapi.fetchone()
|
row = self.dbapi.fetchone()
|
||||||
if row:
|
if row:
|
||||||
self.dbapi.execute("DELETE FROM name_group WHERE name = ?",
|
self.dbapi.execute("UPDATE name_group SET grouping=? "
|
||||||
[name])
|
"WHERE name = ?", [grouping, name])
|
||||||
|
else:
|
||||||
self.dbapi.execute(
|
self.dbapi.execute(
|
||||||
"INSERT INTO name_group (name, grouping) VALUES(?, ?)",
|
"INSERT INTO name_group (name, grouping) VALUES (?, ?)",
|
||||||
[name, grouping])
|
[name, grouping])
|
||||||
|
|
||||||
def _commit_base(self, obj, obj_key, trans, change_time):
|
def _commit_base(self, obj, obj_key, trans, change_time):
|
||||||
|
Loading…
Reference in New Issue
Block a user