-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(php): Rerun the change groupnames for pgsql
Rerun the change groupnames for pgsql when the control migration is to false. Signed-off-by: Baptiste Fotia <[email protected]>
- Loading branch information
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace OCA\Workspace\Migration; | ||
|
||
use OCP\IConfig; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\IRepairStep; | ||
use OCA\Workspace\Upgrade\Upgrade; | ||
use OCA\Workspace\Upgrade\UpgradeV300; | ||
use OCP\AppFramework\Services\IAppConfig; | ||
|
||
class ReRunChangeGroupnamesForPgSql implements IRepairStep | ||
{ | ||
public function __construct( | ||
private IConfig $config, | ||
private IAppConfig $appConfig, | ||
private UpgradeV300 $upgrade, | ||
) | ||
{ | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return 'Rerun the change groupnames repair step for a Nextcloud instance using PostgreSQL.'; | ||
} | ||
|
||
public function run(IOutput $output): void | ||
{ | ||
$sgbdName = $this->config->getSystemValue('dbtype'); | ||
|
||
if ($sgbdName !== 'pgsql') | ||
{ | ||
return; | ||
} | ||
|
||
$statusMigration = boolval($this->appConfig->getAppValue(Upgrade::CONTROL_MIGRATION_V3, '1')); | ||
|
||
if ($statusMigration === true) | ||
{ | ||
return; | ||
} | ||
|
||
$this->upgrade->upgrade(); | ||
} | ||
} |