Commit Graph

1 Commits

Author SHA1 Message Date
4fa0205598 Allow upserting rows with existing_pk even if they do not exist. (#889)
* Allow for __force_save__ in Model.upsert() method to save the models despite they already have a pk set. On integrity Error proceed to update the model, so in worst case two db calls will be made.

* Fix coverage

* Change implementation to checking if the row exists as postgres leaves hanging invalid transaction on integrity error. On force_save always check if row exists and then save/update (so always two queries).
2022-10-21 13:32:36 +02:00