I have the following table in my database:
Type | Name
-------------------------------------------------
INT(10) UNSIGNED | id
LONGTEXT | settings
The settings column holds JSON strings such as the following:
'[
{"value":"1","label":"user_type"},
{"value":"2","label":"email_type"}
]'
I have some corrupt data that doesn't correspond to the required format as the requirements have now changed.
'[
{"value": 8,"label":"should_receive_notifications"},
]'
Notice how the value is unquoted compared to the first example which is how I need them.
Is there a way I can do a find and replace on all JSON strings within the settings column to update all unquoted values in the JSON string and wrap them in quotes?
SELECT VERSION();."value"is the only property needed in such quoting?