I am thinking of a query and wondering if anyone has some ideas:
I have a uuid(foreign key) and a number 1 to 5
I want to achieve the following:
• If uuid + number exists => delete the entry
• If uuid doesn’t exist => create new entry with number
• If uuid exists with different number => update the record
I guess the easiest way would be to just run a delete command (where uuid == $1) and always insert a new record or is there a better way ?