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