diff options
-rw-r--r-- | core/Command/Db/Migrations/PreviewCommand.php | 9 | ||||
-rw-r--r-- | lib/private/Migration/MetadataManager.php | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/core/Command/Db/Migrations/PreviewCommand.php b/core/Command/Db/Migrations/PreviewCommand.php index 6440ed5835c..f364709fc7b 100644 --- a/core/Command/Db/Migrations/PreviewCommand.php +++ b/core/Command/Db/Migrations/PreviewCommand.php @@ -62,6 +62,12 @@ class PreviewCommand extends Command { } $table->render(); + $unsupportedApps = $this->metadataManager->getUnsupportedApps($metadata['migrations']); + if (!empty($unsupportedApps)) { + $output->writeln(''); + $output->writeln('Those apps are not supporting metadata yet and might initiate migrations on upgrade: <info>' . implode(', ', $unsupportedApps) . '</info>'); + } + return 0; } @@ -90,6 +96,9 @@ class PreviewCommand extends Command { /** @var MigrationAttribute[] $attributes */ foreach($data as $migration => $attributes) { $attributesStr = []; + if (empty($attributes)) { + $attributesStr[] = '<comment>(metadata not set)</comment>'; + } foreach($attributes as $attribute) { $definition = '<info>' . $attribute->definition() . "</info>"; $definition .= empty($attribute->getDescription()) ? '' : "\n " . $attribute->getDescription(); diff --git a/lib/private/Migration/MetadataManager.php b/lib/private/Migration/MetadataManager.php index cf569755ecd..3110ee18606 100644 --- a/lib/private/Migration/MetadataManager.php +++ b/lib/private/Migration/MetadataManager.php @@ -60,6 +60,18 @@ class MetadataManager { } /** + * returns list of installed apps that does not support migrations metadata (yet) + * + * @param array<array-key, array<array-key, array>> $metadata + * + * @return string[] + * @since 30.0.0 + */ + public function getUnsupportedApps(array $metadata): array { + return array_values(array_diff($this->appManager->getInstalledApps(), array_keys($metadata['apps']))); + } + + /** * convert raw data to a list of MigrationAttribute * * @param array $migrations |