[OneSignal Plugin] Cannot delete users that are in the OneSignal device entity

Forge Component
(13)
Published on 7 May by OutSystems R&D
13 votes
Published on 7 May by OutSystems R&D

Hello

I am trying to delete users, but I receive the following error:

The DELETE statement conflicted with the REFERENCE constraint "OSFRK_OSUSR_E0U_DEVICE_OSSYS_USER_USERID". The conflict occurred in database "osNOP1", table "dbo.OSUSR_E0U_DEVICE", column 'USERID'. The statement has been terminated.

I got around this before by doing something like clearing the device entity, but I do not know what the implications of this are.

using Service Studio 11

Thanks in advance for the help

Hi Mitchel,

The cause of the error is due to the foreign key constraint from the onesignal entity to the users entity.

In order to delete users and have them be also deleted from the onsignal entity, go to the device entity and change the rule from "protect" to "delete". This will solve your issue.