mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:39:25 +08:00
Fix incorrect migration notes for extensions without any migrations
When running migrations for an extension without any migrations (eg. BBCode), the migration notes for the previous extension were being displayed, because the Migrator never had a chance to clear them.
This commit is contained in:
parent
54be3ad3c8
commit
4f3e67714e
@ -219,6 +219,7 @@ class ExtensionManager
|
||||
*
|
||||
* @param Extension $extension
|
||||
* @param bool|true $up
|
||||
* @return array Notes from the migrator.
|
||||
*/
|
||||
public function migrate(Extension $extension, $up = true)
|
||||
{
|
||||
@ -234,7 +235,11 @@ class ExtensionManager
|
||||
} else {
|
||||
$this->migrator->reset($migrationDir, $extension);
|
||||
}
|
||||
|
||||
return $this->migrator->getNotes();
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,8 +69,6 @@ class MigrateCommand extends AbstractCommand
|
||||
|
||||
$extensions = $this->container->make('Flarum\Extension\ExtensionManager');
|
||||
|
||||
$migrator = $extensions->getMigrator();
|
||||
|
||||
foreach ($extensions->getExtensions() as $name => $extension) {
|
||||
if (! $extension->isEnabled()) {
|
||||
continue;
|
||||
@ -78,9 +76,9 @@ class MigrateCommand extends AbstractCommand
|
||||
|
||||
$this->info('Migrating extension: '.$name);
|
||||
|
||||
$extensions->migrate($extension);
|
||||
$notes = $extensions->migrate($extension);
|
||||
|
||||
foreach ($migrator->getNotes() as $note) {
|
||||
foreach ($notes as $note) {
|
||||
$this->info($note);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user