| @@ 497-504 (lines=8) @@ | ||
| 494 | ||
| 495 | //install the database |
|
| 496 | $appPath = OC_App::getAppPath($app); |
|
| 497 | if (isset($info['use-migrations']) && $info['use-migrations'] === 'true') { |
|
| 498 | $ms = new \OC\DB\MigrationService($app, \OC::$server->getDatabaseConnection()); |
|
| 499 | $ms->migrate(); |
|
| 500 | } else { |
|
| 501 | if(is_file($appPath.'/appinfo/database.xml')) { |
|
| 502 | OC_DB::createDbFromStructure($appPath . '/appinfo/database.xml'); |
|
| 503 | } |
|
| 504 | } |
|
| 505 | ||
| 506 | //run appinfo/install.php |
|
| 507 | \OC_App::registerAutoloading($app, $appPath); |
|
| @@ 1025-1032 (lines=8) @@ | ||
| 1022 | } |
|
| 1023 | $appData = self::getAppInfo($appId); |
|
| 1024 | self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); |
|
| 1025 | if (isset($appData['use-migrations']) && $appData['use-migrations'] === 'true') { |
|
| 1026 | $ms = new \OC\DB\MigrationService($appId, \OC::$server->getDatabaseConnection()); |
|
| 1027 | $ms->migrate(); |
|
| 1028 | } else { |
|
| 1029 | if (file_exists($appPath . '/appinfo/database.xml')) { |
|
| 1030 | OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); |
|
| 1031 | } |
|
| 1032 | } |
|
| 1033 | self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']); |
|
| 1034 | self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']); |
|
| 1035 | unset(self::$appVersion[$appId]); |
|