update the hash column in json data table on duplicate entry w/ burnettk (#1750)
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
24f578fefa
commit
9957fc144a
|
@ -67,7 +67,7 @@ class JsonDataModel(SpiffworkflowBaseDBModel):
|
||||||
on_duplicate_key_stmt = None
|
on_duplicate_key_stmt = None
|
||||||
if current_app.config["SPIFFWORKFLOW_BACKEND_DATABASE_TYPE"] == "mysql":
|
if current_app.config["SPIFFWORKFLOW_BACKEND_DATABASE_TYPE"] == "mysql":
|
||||||
insert_stmt = mysql_insert(JsonDataModel).values(list_of_dicts)
|
insert_stmt = mysql_insert(JsonDataModel).values(list_of_dicts)
|
||||||
on_duplicate_key_stmt = insert_stmt.on_duplicate_key_update(data=insert_stmt.inserted.data)
|
on_duplicate_key_stmt = insert_stmt.on_duplicate_key_update(hash=insert_stmt.inserted.hash)
|
||||||
else:
|
else:
|
||||||
insert_stmt = postgres_insert(JsonDataModel).values(list_of_dicts)
|
insert_stmt = postgres_insert(JsonDataModel).values(list_of_dicts)
|
||||||
on_duplicate_key_stmt = insert_stmt.on_conflict_do_nothing(index_elements=["hash"])
|
on_duplicate_key_stmt = insert_stmt.on_conflict_do_nothing(index_elements=["hash"])
|
||||||
|
|
Loading…
Reference in New Issue