Skip to content

Commit

Permalink
Fixes diffs column type when JSON type is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Jul 4, 2023
1 parent 26a83bc commit 2fd4f3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Provider/Doctrine/Persistence/Schema/SchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit 2fd4f3e

Please sign in to comment.