mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #47069 from nextcloud/fix/noid/display-message-on-no-migration-attributes
fix(migration-preview): display a message if no attributes set
This commit is contained in:
commit
3ffcfb1dab
2 changed files with 21 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -88,6 +88,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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue