From 2fd4f3efaeb54bb837e98e54ddffd04e037f4419 Mon Sep 17 00:00:00 2001 From: damienharper Date: Tue, 4 Jul 2023 10:51:44 +0200 Subject: [PATCH] Fixes `diffs` column type when JSON type is supported --- src/Provider/Doctrine/Persistence/Schema/SchemaManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php b/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php index 5e352836..d0b5c07e 100644 --- a/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php +++ b/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php @@ -168,7 +168,7 @@ public function createAuditTable(string $entity, ?Schema $schema = null): Schema // Add columns to audit table $isJsonSupported = PlatformHelper::isJsonSupported($connection); foreach (SchemaHelper::getAuditTableColumns() as $columnName => $struct) { - if (Types::JSON === $struct['type'] && $isJsonSupported) { + if (Types::JSON === $struct['type'] && !$isJsonSupported) { $type = Types::TEXT; } else { $type = $struct['type']; @@ -282,7 +282,7 @@ private function processColumns(Table $table, array $columns, array $expectedCol // column is part of expected columns $table->dropColumn($column->getName()); - if (Types::JSON === $expectedColumns[$column->getName()]['type'] && $isJsonSupported) { + if (Types::JSON === $expectedColumns[$column->getName()]['type'] && !$isJsonSupported) { $type = Types::TEXT; } else { $type = $expectedColumns[$column->getName()]['type'];