-
Notifications
You must be signed in to change notification settings - Fork 301
Closed
Description
The upsert function inserts or updates an existing record. It works fine if there's one uniqueness constraint, but if there are two it doesn't know which to use, and throws an exception. This is pretty lame: you wouldn't think that adding a new uniqueness constraint would cause a runtime exception in a related area of your code. Users should just use upsertBy, or if their database supports a way of not specifying it, use that functionality (e.g. the MySQL module exposes insertOnDuplicateKeyUpdate; I think Postgres requires specifying the column(s)).
This would resolve issues like #768 and avoid all the documentation of this caveat in #785.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels