diff --git a/Content/Infrastructure/Doctrine/MetadataLoader.php b/Content/Infrastructure/Doctrine/MetadataLoader.php index 0005e86a..5e41621e 100644 --- a/Content/Infrastructure/Doctrine/MetadataLoader.php +++ b/Content/Infrastructure/Doctrine/MetadataLoader.php @@ -64,7 +64,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $event): void if ($reflection->implementsInterface(TemplateInterface::class)) { $this->addField($metadata, 'templateKey', 'string', ['length' => 32]); - $this->addField($metadata, 'templateData', 'json', ['nullable' => false]); + $this->addField($metadata, 'templateData', 'json', ['nullable' => false, 'options' => ['jsonb' => true]]); $this->addIndex($metadata, 'idx_template_key', ['templateKey']); } diff --git a/UPGRADE.md b/UPGRADE.md index 99f5c399..d54567b8 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,14 @@ # Upgrade +## 0.6.x + +### Use jsonb for PostgreSQL json columns + +This effects only PostgreSQL databases: + +```sql +ALTER TABLE _example_dimensions ALTER COLUMN templateData SET DATA TYPE jsonb USING templateData::jsonb; + ## 0.6.3 ### Add dimension, templateKey, workflowPublished and workflowPlace indexes