Add option to create all app schemas instead of just installed app.
This commit is contained in:
parent
5ef7d69d41
commit
370593361b
1 changed files with 7 additions and 1 deletions
|
@ -98,6 +98,12 @@ class ConvertType extends Command {
|
||||||
InputOption::VALUE_NONE,
|
InputOption::VALUE_NONE,
|
||||||
'remove all tables from the destination database'
|
'remove all tables from the destination database'
|
||||||
)
|
)
|
||||||
|
->addOption(
|
||||||
|
'all-apps',
|
||||||
|
null,
|
||||||
|
InputOption::VALUE_NONE,
|
||||||
|
'whether to create schema for all apps instead of only installed apps'
|
||||||
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +126,7 @@ class ConvertType extends Command {
|
||||||
$output->writeln('<info>Creating schema in new database</info>');
|
$output->writeln('<info>Creating schema in new database</info>');
|
||||||
$schemaManager = new \OC\DB\MDB2SchemaManager($toDB);
|
$schemaManager = new \OC\DB\MDB2SchemaManager($toDB);
|
||||||
$schemaManager->createDbFromStructure(\OC::$SERVERROOT.'/db_structure.xml');
|
$schemaManager->createDbFromStructure(\OC::$SERVERROOT.'/db_structure.xml');
|
||||||
$apps = \OC_App::getEnabledApps();
|
$apps = $input->getOption('all-apps') ? \OC_App::getAllApps() : \OC_App::getEnabledApps();
|
||||||
foreach($apps as $app) {
|
foreach($apps as $app) {
|
||||||
if(file_exists(\OC_App::getAppPath($app).'/appinfo/database.xml')) {
|
if(file_exists(\OC_App::getAppPath($app).'/appinfo/database.xml')) {
|
||||||
$schemaManager->createDbFromStructure(\OC_App::getAppPath($app).'/appinfo/database.xml');
|
$schemaManager->createDbFromStructure(\OC_App::getAppPath($app).'/appinfo/database.xml');
|
||||||
|
|
Loading…
Reference in a new issue