SQL error when deleting configurations
I'm experiencing an error when I try to delete a configuration from the frontend, eg:
DELETE http://rz-vm64.gfz-potsdam.de:5000/rdm/svm-api/v1/configurations/32
returns:
STATUS: 500 INTERNAL SERVER ERROR
{
"errors":[
{
"detail":"Delete object error: (psycopg2.errors.NotNullViolation) null value in column \"configuration_id\" violates not-null constraint\nDETAIL: Failing row contains (2021-08-23 09:21:36.678693, 2021-08-24 11:22:32.644983, 24, null, 279, null, 2021-08-23 09:12:34.586, , 14, 0, 0, 0, 6, 6).\n\n[SQL: UPDATE device_mount_action SET updated_at=%(updated_at)s, configuration_id=%(configuration_id)s WHERE device_mount_action.id = %(device_mount_action_id)s]\n[parameters: {'updated_at': datetime.datetime(2021, 8, 24, 11, 22, 32, 644983), 'configuration_id': None, 'device_mount_action_id': 24}]\n(Background on this error at: http://sqlalche.me/e/14/gkpj)",
"status":"500",
"title":"Unknown error"
}
],
"jsonapi":{
"version":"1.0"
}
}
It looks like the ON DELETE
constraint for the referenced tables was not set to CASCADE
...
Edited by Marc Hanisch