I have a table which has a column named "data" of type JSONB. I am trying to come up with a SQL statement to accomoodate the recent model changes. (postgres 9.4)
"isIndiaGSTComposition" in old model needs to be changed as "auxiliaryProperties" data structure (below) in the new model.
{
"test":{
"isIndiaGSTComposition":true (boolean)
}
}
New model :
{
"test":{
"AuxiliaryProperties":[
{
"id":"indiaGSTComposition",
"booleanValue":true
}
]
}
}
Please note that, if isIndiaGSTComposition is null, it should be auxiliaryProperties : null. But if it has true or false, it needs to be in the above data structure format(like in "new model" example above).
Any help is appreciated. Thanks in advance !