| @@ 496-503 (lines=8) @@ | ||
| 493 | ||
| 494 | //install the database |
|
| 495 | $appPath = OC_App::getAppPath($app); |
|
| 496 | if (isset($info['use-migrations']) && $info['use-migrations'] === 'true') { |
|
| 497 | $ms = new \OC\DB\MigrationService($app, \OC::$server->getDatabaseConnection()); |
|
| 498 | $ms->migrate(); |
|
| 499 | } else { |
|
| 500 | if(is_file($appPath.'/appinfo/database.xml')) { |
|
| 501 | OC_DB::createDbFromStructure($appPath . '/appinfo/database.xml'); |
|
| 502 | } |
|
| 503 | } |
|
| 504 | ||
| 505 | //run appinfo/install.php |
|
| 506 | \OC_App::registerAutoloading($app, $appPath); |
|
| @@ 1060-1067 (lines=8) @@ | ||
| 1057 | } |
|
| 1058 | $appData = self::getAppInfo($appId); |
|
| 1059 | self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); |
|
| 1060 | if (isset($appData['use-migrations']) && $appData['use-migrations'] === 'true') { |
|
| 1061 | $ms = new \OC\DB\MigrationService($appId, \OC::$server->getDatabaseConnection()); |
|
| 1062 | $ms->migrate(); |
|
| 1063 | } else { |
|
| 1064 | if (file_exists($appPath . '/appinfo/database.xml')) { |
|
| 1065 | OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); |
|
| 1066 | } |
|
| 1067 | } |
|
| 1068 | self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']); |
|
| 1069 | self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']); |
|
| 1070 | unset(self::$appVersion[$appId]); |
|