Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/Command/Db/Migrations/PreviewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public function execute(InputInterface $input, OutputInterface $output): int {
}
$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;
}

Expand Down Expand Up @@ -90,6 +96,9 @@ private function displayMigrations(Table $table, string $appId, array $data): vo
/** @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();
Expand Down
12 changes: 12 additions & 0 deletions lib/private/Migration/MetadataManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ public function getMigrationsAttributesFromReleaseMetadata(
];
}

/**
* 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
*
Expand Down