jonathan
(Mutagubya Jonathan)
August 23, 2023, 10:35am
1
Hey team,
I have a concept its updated in OCL to datatype Coded however its not updating on fetching
So have tried to delete it manually and then re-fetch however am facing this challenge
Cannot delete concept. Database constraints will be violated because this concept is in use by other objects.
Basically is there a way to force delete without deleting the all concepts from the db with all attached contraints
cc @dkayiwa @mozzy @ibacher
west
(West Onyinsi)
August 23, 2023, 12:03pm
2
Greetings, you could try finding the objects that require the concept and redefine them to no longer need it? Let me know how it goes
grace
(Grace Potma)
August 31, 2023, 3:40am
3
@ball I imagine you have encountered this or similar situations before. How have you handled this?
ball
(Ellen Ball)
August 31, 2023, 12:28pm
4
@jonathan You have an obs (observation) with data for that concept. What was the previous datatype?
Try running this to find the obs in your database. If you don’t need it, you can delete that obs:
select * from obs where concept_id = 168826;
ibacher
(Ian Bacher)
August 31, 2023, 12:51pm
5
This doesn’t look like your concept is actually maintained via the Open Concept Lab module. If it was, you should see a header like this:
(Note that the text here is fixed and doesn’t take into account that the concept in question was actually just created from a zip and not actually downloaded from OCL). This means that there’s no mechanism that will automatically update that concept.
jonathan
(Mutagubya Jonathan)
September 1, 2023, 12:36pm
6
thanks @ball the previous datatype was Numeric
and was changed to Coded
and seems according to @ibacher comment it might be the issue why its not updating
jonathan
(Mutagubya Jonathan)
September 1, 2023, 12:38pm
7
Actually @ibacher we use both dumps and ocl …so it might be that i used a dump with this concept …
jonathan
(Mutagubya Jonathan)
September 1, 2023, 12:42pm
8
thanks @grace , @ball this actually has helped out deleting the obs associated with the concept helps to delete the concept
ball
(Ellen Ball)
September 1, 2023, 12:51pm
9
@jonathan Glad that you fixed the problem.
It’s ok to delete an obs when it’s a test database, but you wouldn’t want to do this on production. You would likely chooise/create a new concept with a datatype of coded instead of numeric
2 Likes