#How would you set unique constraints, but ignore if row is soft deleted?
15 messages · Page 1 of 1 (latest)
I think that will just create a unique index on both column, which will allow multiple rows with the same key, so long as the deleted_at is different?
That is fine, because they don't care about deleted_at items. However, when they aren't deleted - it is null, and ignored.
So only the key will be used for unique.
Then when it is deleted, the date will be used as well making it no longer match the unique qualifier.
Which is what they are looking for.
My bad… shouldn’t be checking my phone halfway though the night and trying to make sense of things…
lol I literally tried that before and it didn't work
I gave it one more shot
and now it works
probably I was screwing up on something at some point
ty btw @little night
@sour wing You should reuse the historical record instead of creating a new record.