From 0bd0188c438f04bdc063d67860bcdcb5dd86f431 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Wed, 5 Oct 2022 12:50:52 +0200 Subject: [PATCH 1/3] Add jsonb option. --- Content/Infrastructure/Doctrine/MetadataLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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']); } From 4fea3bc0d37f38232883971f05becce3a83aa9e1 Mon Sep 17 00:00:00 2001 From: Mario Fehr Date: Thu, 6 Oct 2022 13:47:29 +0200 Subject: [PATCH 2/3] Add infos for upgrade.md --- UPGRADE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 99f5c399..1b0e279e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,16 @@ # Upgrade +## 0.6.x + +### Add jsonb support for postgresql tables + +```postgresql +ALTER TABLE test_example_dimensions + ALTER COLUMN templateData + SET DATA TYPE jsonb + USING templateData::jsonb; +``` + ## 0.6.3 ### Add dimension, templateKey, workflowPublished and workflowPlace indexes From 56204d362b2ec0e83c247f14f68858a72e38398e Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Sat, 8 Oct 2022 13:29:51 +0200 Subject: [PATCH 3/3] Update UPGRADE.md --- UPGRADE.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 1b0e279e..d54567b8 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,14 +2,12 @@ ## 0.6.x -### Add jsonb support for postgresql tables +### Use jsonb for PostgreSQL json columns -```postgresql -ALTER TABLE test_example_dimensions - ALTER COLUMN templateData - SET DATA TYPE jsonb - USING templateData::jsonb; -``` +This effects only PostgreSQL databases: + +```sql +ALTER TABLE _example_dimensions ALTER COLUMN templateData SET DATA TYPE jsonb USING templateData::jsonb; ## 0.6.3