Upgrading from Symfony 3 to 4 - JSON Database Content

My latest adventure has been to upgrade a web application from Symfony 3.3 to 4. All the pages load and I am starting to test execution.

This error came up and I scoured the code for instances of AppBundle

Upgrading from Symfony 3 to 4 - JSON Database Content

Then I checked the database.

One of the attributes is custom_attributes, which is a JSON column. Sample content:

[{"#type":"AppBundle\\Entity\\CustomAttribute","key":"expiration","value":"2018-02-26","valueValidExpiration":true,"valueValidChannels":true},{"#type":"AppBundle\\Entity\
\CustomAttribute","key":"channels","value":6,"valueValidExpiration":true,"valueValidChannels":true}]

I am using https://github.com/dunglas/doctrine-json-odm to provide JSON data within entities.

To change AppBundle to App, I used:

Code

dev=# UPDATE asset SET custom_attributes= REPLACE(custom_attributes::TEXT,'AppBundle','App')::json;
UPDATE 25
dev=# UPDATE model SET custom_attributes= REPLACE(custom_attributes::TEXT,'AppBundle','App')::json;
UPDATE 9