[almighty] Gorm cannot recreate soft-deleted WorkItemTypes
Max Rydahl Andersen
manderse at redhat.com
Wed Nov 16 10:40:52 UTC 2016
is this not an argument for using unique id's rather than business names
as primary keys ?
/max
> Hi Folks,
>
> I have just come across the issue
> https://github.com/jinzhu/gorm/issues/759 when trying to create and
> delete work item types for a test. The gist is: gorm can't recreate
> objects that have been soft-deleted. Using "Unscoped()" does not work
> in this instance, since the soft-deleted work items remain in in the
> database and have a dangling foreign key to the work item types. The
> bug has been close, so I don't think there will be a fix for it. I'm
> writing this because I want people to be aware of the issue.
> For our concrete example, I am going to follow one of the suggestions
> from the bug:
>
>> 1, Use ThreadName & DeletedAt as combined unique index
>
> When "DeletedAt" is nil, it becomes the same uniqueness condition as
> we have now. The FK on work_items will have to be fixed, as well.
>
> /Thomas
>
>
> _______________________________________________
> almighty-public mailing list
> almighty-public at redhat.com
> https://www.redhat.com/mailman/listinfo/almighty-public
/max
http://about.me/maxandersen
More information about the almighty-public
mailing list