Skip to content

Commit

Permalink
fix: Only return $schema if there was changes in migration
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jan 9, 2025
1 parent 60ff87b commit 8dd95d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Migration/Version19000Date20241029123147.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

class Version19000Date20241029123147 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
Expand All @@ -29,9 +26,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$table = $schema->getTable('group_folders');
if (!$table->hasIndex('gf_folders_folder_id')) {
$table->addUniqueIndex(['folder_id'], 'gf_folders_folder_id');
return $schema;
}
}

return $schema;
return null;
}
}

0 comments on commit 8dd95d3

Please sign in to comment.