[almighty] Gorm cannot recreate soft-deleted WorkItemTypes
Max Rydahl Andersen
manderse at redhat.com
Wed Nov 16 11:01:27 UTC 2016
On 16 Nov 2016, at 11:51, Thomas Mäder wrote:
> HI Max,
>
> On 11/16/2016 11:40 AM, Max Rydahl Andersen wrote:
>> is this not an argument for using unique id's rather than business
>> names as primary keys ?
> That question is totally unrelated. The constraint is still that you
> can't have two types with the same name (because clients refer to them
> by unique name). So you still want to have the uniqueness constraint
> and you still have the problem, even with an artificial ID.
I must be missing something then. If I have an artificial ID that is
what the clients will use to refer to them.
But okey, your issue is not really with gorm then - even you access it
raw you would have this problem since its about the database
constraints, right ?
Only ways to solve this issue afaik:
A) don't care about the database enforcing the constraint
B) don't do soft deletes in the table, move the old data to a separate
table without the constraint
C) don't do soft deletes for this part of the model
/max
http://about.me/maxandersen
More information about the almighty-public
mailing list