From b64d7890ca896d824eb012d178ce03526481222d Mon Sep 17 00:00:00 2001 From: mokaddem Date: Tue, 29 Jun 2021 10:56:40 +0200 Subject: [PATCH 1/2] fix: [migrations:localTools] Make sure the table do not exists before creating it --- .../Migrations/20210601125359_LocalTools.php | 75 ++++++++++--------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/config/Migrations/20210601125359_LocalTools.php b/config/Migrations/20210601125359_LocalTools.php index 652ce09..f8ea88b 100644 --- a/config/Migrations/20210601125359_LocalTools.php +++ b/config/Migrations/20210601125359_LocalTools.php @@ -17,46 +17,49 @@ class LocalTools extends AbstractMigration */ public function change() { - $table = $this->table('local_tools', [ - 'signed' => false, - 'collation' => 'utf8mb4_unicode_ci', - ]); - $table - ->addColumn('id', 'integer', [ - 'autoIncrement' => true, - 'limit' => 10, + $exists = $this->hasTable('local_tools'); + if (!$exists) { + $table = $this->table('local_tools', [ 'signed' => false, - ]) - ->addPrimaryKey('id') - ->addColumn('name', 'string', [ - 'default' => null, - 'null' => false, - 'limit' => 191, - 'comment' => 'The name of the individual connection', - ]) - ->addColumn('connector', 'string', [ - 'default' => null, - 'null' => false, - 'limit' => 191, - 'comment' => 'The library name used for the connection', - ]) - ->addColumn('settings', 'text', [ - 'default' => null, - 'null' => true, - ]) - ->addColumn('exposed', 'boolean', [ - 'default' => 0, - 'null' => false, - ]) - ->addColumn('description', 'text', [ - 'default' => null, - 'null' => true, + 'collation' => 'utf8mb4_unicode_ci', ]); + $table + ->addColumn('id', 'integer', [ + 'autoIncrement' => true, + 'limit' => 10, + 'signed' => false, + ]) + ->addPrimaryKey('id') + ->addColumn('name', 'string', [ + 'default' => null, + 'null' => false, + 'limit' => 191, + 'comment' => 'The name of the individual connection', + ]) + ->addColumn('connector', 'string', [ + 'default' => null, + 'null' => false, + 'limit' => 191, + 'comment' => 'The library name used for the connection', + ]) + ->addColumn('settings', 'text', [ + 'default' => null, + 'null' => true, + ]) + ->addColumn('exposed', 'boolean', [ + 'default' => 0, + 'null' => false, + ]) + ->addColumn('description', 'text', [ + 'default' => null, + 'null' => true, + ]); - $table->addIndex('name') - ->addIndex('connector'); + $table->addIndex('name') + ->addIndex('connector'); - $table->create(); + $table->create(); + } } } From 39c848202ab696259e2f8933847c3ccefb7a529b Mon Sep 17 00:00:00 2001 From: mokaddem Date: Tue, 29 Jun 2021 11:26:06 +0200 Subject: [PATCH 2/2] chg: [users:index] Allow quick filters --- src/Controller/UsersController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index 9126e87..9df380f 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -13,7 +13,8 @@ class UsersController extends AppController { $this->CRUD->index([ 'contain' => ['Individuals', 'Roles'], - 'filters' => ['Users.email', 'uuid'] + 'filters' => ['Users.email', 'uuid'], + 'quickFilters' => ['uuid', ['username' => true], ['Individuals.first_name' => true], ['Individuals.last_name' => true], 'Individuals.email'], ]); if ($this->ParamHandler->isRest()) { return $this->restResponsePayload;