onConflictDoUpdate error, there is no unique or exclusion constraint matching the ON CONFLICT
My goal is to insert new data into the storespecialhours table. If there is a conflict with specialDateID or (storeID and Day) then do an update. Lots of rows can have conflicting dayOpen, dayClose or day attributes that conflict.
How do I fix it? Currently I am getting:
there is no unique or exclusion constraint matching the ON CONFLICT specification
2 Replies
Did you ever find a solution to this? I've run into a similar issue and found your post
Hi, newbie trying to help
The error message that you get indicates that there's no unique constraint placed on the column on the database level
Can you check your table structure and make sure that unique constraints index is placed on those columns ?