Skip to content

Commit

Permalink
Merge pull request #170 from DamienHarper/issue-52
Browse files Browse the repository at this point in the history
Fixes `diffs` column type when JSON type is supported
  • Loading branch information
DamienHarper committed Jul 4, 2023
2 parents 87a8cbb + bd8435f commit 791d56f
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 @@ -174,7 +174,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 @@ -290,7 +290,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 791d56f

Please sign in to comment.