Skip to content

Commit

Permalink
Update Version24000Date20211222112246.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen authored Mar 15, 2022
1 parent 6c01863 commit 3031eb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/Migrations/Version24000Date20211222112246.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$action = false;
$comments = $schema->getTable('comments');
if (!$comments->hasColumn('reactions')) {
$comments->addColumn('reactions', Types::STRING, [
'notnull' => false,
'length' => 4000,
]);
$action = true;
}

if (!$schema->hasTable(self::TABLE_NAME)) {
Expand Down Expand Up @@ -89,8 +91,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$table->addIndex(['reaction'], 'comment_reaction');
$table->addIndex(['parent_id'], 'comment_reaction_parent_id');
$table->addUniqueIndex(['parent_id', 'actor_type', 'actor_id', 'reaction'], 'comment_reaction_unique');
return $schema;
$action = true;
}
return null;
return $action ? $schema : null;
}
}

0 comments on commit 3031eb1

Please sign in to comment.