From f068d18d495a9ca554f00d0c0bf0843bdc108dbf Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 4 Oct 2021 11:01:20 +0200 Subject: [PATCH] fix: [application:migration] Better support of plugin migration --- src/Controller/InstanceController.php | 1 + src/Model/Table/InstanceTable.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/InstanceController.php b/src/Controller/InstanceController.php index 8b88e47..8479e5c 100644 --- a/src/Controller/InstanceController.php +++ b/src/Controller/InstanceController.php @@ -62,6 +62,7 @@ class InstanceController extends AppController foreach ($status as $i => $entry) { if (!empty($entry['plugin'])) { $pluginTablename = sprintf('%s_phinxlog', Inflector::underscore($entry['plugin'])); + $pluginTablename = str_replace(['\\', '/', '.'], '_', $pluginTablename); $status[$i] = $this->Phinxlog->mergeMigrationLogIntoStatus([$entry], $pluginTablename)[0]; } diff --git a/src/Model/Table/InstanceTable.php b/src/Model/Table/InstanceTable.php index dcb9741..0ec2a53 100644 --- a/src/Model/Table/InstanceTable.php +++ b/src/Model/Table/InstanceTable.php @@ -12,7 +12,7 @@ use Cake\Http\Exception\MethodNotAllowedException; class InstanceTable extends AppTable { - protected $activePlugins = ['Tags']; + protected $activePlugins = ['Tags', 'ADmad/SocialAuth']; public $seachAllTables = ['Broods', 'Individuals', 'Organisations', 'SharingGroups', 'Users', 'EncryptionKeys', ]; public function initialize(array $config): void @@ -152,6 +152,8 @@ class InstanceTable extends AppTable } else { $migrationResult = $migrations->migrate(['target' => $version]); } + $command = ROOT . '/bin/cake schema_cache clear'; + $output = shell_exec($command); return [ 'success' => true ];