From c647ae95ebd8a5881fb4173f4055f450d1295013 Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Wed, 24 Nov 2021 13:44:12 +0100 Subject: [PATCH 01/11] fix: typo in mysql.sql --- INSTALL/mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL/mysql.sql b/INSTALL/mysql.sql index 6bd956c..936df41 100644 --- a/INSTALL/mysql.sql +++ b/INSTALL/mysql.sql @@ -408,7 +408,7 @@ CREATE TABLE IF NOT EXISTS `audit_logs` ( KEY `ip` (`ip`), KEY `model` (`model`), KEY `action` (`action`), - KEY `model_id` (`model_id`) + KEY `model_id` (`model_id`), KEY `created` (`created`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 8ca22760e029a4da62156c1d32878dd81b767673 Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Wed, 24 Nov 2021 13:47:10 +0100 Subject: [PATCH 02/11] fix: [mysql] create if exists rather than drop + create - made sense early in development, however, it no longer does --- INSTALL/mysql.sql | 51 +++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/INSTALL/mysql.sql b/INSTALL/mysql.sql index 936df41..799cda8 100644 --- a/INSTALL/mysql.sql +++ b/INSTALL/mysql.sql @@ -19,10 +19,9 @@ -- Table structure for table `alignment_tags` -- -DROP TABLE IF EXISTS `alignment_tags`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `alignment_tags` ( +CREATE TABLE IF NOT EXISTS `alignment_tags` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `alignment_id` int(10) unsigned NOT NULL, `tag_id` int(10) unsigned NOT NULL, @@ -48,10 +47,9 @@ CREATE TABLE `alignment_tags` ( -- Table structure for table `alignments` -- -DROP TABLE IF EXISTS `alignments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `alignments` ( +CREATE TABLE IF NOT EXISTS `alignments` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `individual_id` int(10) unsigned NOT NULL, `organisation_id` int(10) unsigned NOT NULL, @@ -68,10 +66,9 @@ CREATE TABLE `alignments` ( -- Table structure for table `auth_keys` -- -DROP TABLE IF EXISTS `auth_keys`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `auth_keys` ( +CREATE TABLE IF NOT EXISTS `auth_keys` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, `authkey` varchar(72) CHARACTER SET ascii DEFAULT NULL, @@ -94,10 +91,9 @@ CREATE TABLE `auth_keys` ( -- Table structure for table `broods` -- -DROP TABLE IF EXISTS `broods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `broods` ( +CREATE TABLE IF NOT EXISTS `broods` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -122,10 +118,9 @@ CREATE TABLE `broods` ( -- Table structure for table `encryption_keys` -- -DROP TABLE IF EXISTS `encryption_keys`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `encryption_keys` ( +CREATE TABLE IF NOT EXISTS `encryption_keys` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -145,10 +140,9 @@ CREATE TABLE `encryption_keys` ( -- Table structure for table `individual_encryption_keys` -- -DROP TABLE IF EXISTS `individual_encryption_keys`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `individual_encryption_keys` ( +CREATE TABLE IF NOT EXISTS `individual_encryption_keys` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `individual_id` int(10) unsigned NOT NULL, `encryption_key_id` int(10) unsigned NOT NULL, @@ -168,10 +162,9 @@ CREATE TABLE `individual_encryption_keys` ( -- Table structure for table `individuals` -- -DROP TABLE IF EXISTS `individuals`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `individuals` ( +CREATE TABLE IF NOT EXISTS `individuals` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -190,8 +183,7 @@ CREATE TABLE `individuals` ( -- Table structure for table `local_tools` -- -DROP TABLE IF EXISTS `local_tools`; -CREATE TABLE `local_tools` ( +CREATE TABLE IF NOT EXISTS `local_tools` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `connector` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -207,10 +199,9 @@ CREATE TABLE `local_tools` ( -- Table structure for table `organisation_encryption_keys` -- -DROP TABLE IF EXISTS `organisation_encryption_keys`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `organisation_encryption_keys` ( +CREATE TABLE IF NOT EXISTS `organisation_encryption_keys` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `organisation_id` int(10) unsigned NOT NULL, `encryption_key_id` int(10) unsigned NOT NULL, @@ -226,10 +217,9 @@ CREATE TABLE `organisation_encryption_keys` ( -- Table structure for table `organisations` -- -DROP TABLE IF EXISTS `organisations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `organisations` ( +CREATE TABLE IF NOT EXISTS `organisations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -252,10 +242,9 @@ CREATE TABLE `organisations` ( -- Table structure for table `roles` -- -DROP TABLE IF EXISTS `roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `roles` ( +CREATE TABLE IF NOT EXISTS `roles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -271,10 +260,9 @@ CREATE TABLE `roles` ( -- Table structure for table `tags` -- -DROP TABLE IF EXISTS `tags`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `tags` ( +CREATE TABLE IF NOT EXISTS `tags` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` text COLLATE utf8mb4_unicode_ci, @@ -288,10 +276,7 @@ CREATE TABLE `tags` ( -- Table structure for table `users` -- -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users` ( +CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -309,7 +294,7 @@ CREATE TABLE `users` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; -CREATE TABLE `sharing_groups` ( +CREATE TABLE IF NOT EXISTS `sharing_groups` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, @@ -326,7 +311,7 @@ CREATE TABLE `sharing_groups` ( KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -CREATE TABLE `sgo` ( +CREATE TABLE IF NOT EXISTS `sgo` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `sharing_group_id` int(10) unsigned NOT NULL, `organisation_id` int(10) unsigned NOT NULL, @@ -336,7 +321,7 @@ CREATE TABLE `sgo` ( KEY `organisation_id` (`organisation_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -CREATE TABLE `meta_fields` ( +CREATE TABLE IF NOT EXISTS `meta_fields` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `scope` varchar(191) NOT NULL, `parent_id` int(10) unsigned NOT NULL, @@ -356,7 +341,7 @@ CREATE TABLE `meta_fields` ( KEY `meta_template_field_id` (`meta_template_field_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -CREATE TABLE `meta_templates` ( +CREATE TABLE IF NOT EXISTS `meta_templates` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `scope` varchar(191) NOT NULL, `name` varchar(191) NOT NULL, @@ -376,7 +361,7 @@ CREATE TABLE `meta_templates` ( KEY `uuid` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -CREATE TABLE `meta_template_fields` ( +CREATE TABLE IF NOT EXISTS `meta_template_fields` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `field` varchar(191) NOT NULL, `type` varchar(191) NOT NULL, From 19b98a0df4b03380f9e5b5397c2c711f346a84ed Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Wed, 24 Nov 2021 13:48:20 +0100 Subject: [PATCH 03/11] fix: [mysql] renamed field without renaming the associated index --- INSTALL/mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL/mysql.sql b/INSTALL/mysql.sql index 799cda8..627a3b6 100644 --- a/INSTALL/mysql.sql +++ b/INSTALL/mysql.sql @@ -390,7 +390,7 @@ CREATE TABLE IF NOT EXISTS `audit_logs` ( `change` blob, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), - KEY `ip` (`ip`), + KEY `request_ip` (`request_ip`), KEY `model` (`model`), KEY `action` (`action`), KEY `model_id` (`model_id`), From 2ac32911bb22ffe8f929812d8c398d16cb5c18b7 Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Wed, 24 Nov 2021 13:50:20 +0100 Subject: [PATCH 04/11] fix: [mysql] action field renamed without renaming the index --- INSTALL/mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL/mysql.sql b/INSTALL/mysql.sql index 627a3b6..ed39991 100644 --- a/INSTALL/mysql.sql +++ b/INSTALL/mysql.sql @@ -392,7 +392,7 @@ CREATE TABLE IF NOT EXISTS `audit_logs` ( KEY `user_id` (`user_id`), KEY `request_ip` (`request_ip`), KEY `model` (`model`), - KEY `action` (`action`), + KEY `request_action` (`request_action`), KEY `model_id` (`model_id`), KEY `created` (`created`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From eb0a67327ae96a2b0f33f2d2e0d92cf5506da843 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 14:46:34 +0100 Subject: [PATCH 05/11] fix: [initial user] generation fixed - requires a default organisation + org link now --- src/Model/Table/UsersTable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index cb189aa..1b5d09f 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -12,6 +12,7 @@ use \Cake\Http\Session; use Cake\Http\Client; use Cake\Utility\Security; use Cake\Core\Configure; +use Cake\Utility\Text; class UsersTable extends AppTable { @@ -105,6 +106,12 @@ class UsersTable extends AppTable 'perm_admin' => 1 ]); $this->Roles->save($role); + $this->Organisations = TableRegistry::get('Organisations'); + $organisation = $this->Organisations->newEntity([ + 'name' => 'default_organisation', + 'uuid' => Text::uuid() + ]); + $this->Organisations->save($organisation); $this->Individuals = TableRegistry::get('Individuals'); $individual = $this->Individuals->newEntity([ 'email' => 'admin@admin.test', @@ -116,6 +123,7 @@ class UsersTable extends AppTable 'username' => 'admin', 'password' => 'Password1234', 'individual_id' => $individual->id, + 'oganisation_id' => $organisation->id, 'role_id' => $role->id ]); $this->save($user); From 716f6b114750422e2bb96c1817a44f69575897e0 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:24:04 +0100 Subject: [PATCH 06/11] fix: [default user creation] explicitly create UUIDs --- src/Model/Table/UsersTable.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 1b5d09f..37a76e1 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -97,13 +97,28 @@ class UsersTable extends AppTable return $rules; } + public function test() + { + $this->Roles = TableRegistry::get('Roles'); + $role = $this->Roles->newEntity([ + 'name' => 'admin', + 'perm_admin' => 1, + 'perm_org_admin' => 1, + 'perm_sync' => 1 + ]); + $this->Roles->save($role); + } + public function checkForNewInstance(): bool { if (empty($this->find()->first())) { $this->Roles = TableRegistry::get('Roles'); $role = $this->Roles->newEntity([ 'name' => 'admin', - 'perm_admin' => 1 + 'uuid' => Text::uuid(), + 'perm_admin' => 1, + 'perm_org_admin' => 1, + 'perm_sync' => 1 ]); $this->Roles->save($role); $this->Organisations = TableRegistry::get('Organisations'); @@ -115,12 +130,14 @@ class UsersTable extends AppTable $this->Individuals = TableRegistry::get('Individuals'); $individual = $this->Individuals->newEntity([ 'email' => 'admin@admin.test', + 'uuid' => Text::uuid(), 'first_name' => 'admin', 'last_name' => 'admin' ]); $this->Individuals->save($individual); $user = $this->newEntity([ 'username' => 'admin', + 'uuid' => Text::uuid(), 'password' => 'Password1234', 'individual_id' => $individual->id, 'oganisation_id' => $organisation->id, From c7768921fb98d9a3027b9a0eecf353c219807f9e Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:32:17 +0100 Subject: [PATCH 07/11] fix: [user init] explicit uuid creation removed - added behavior wherever it was missing --- src/Model/Table/OrganisationsTable.php | 1 + src/Model/Table/UsersTable.php | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Model/Table/OrganisationsTable.php b/src/Model/Table/OrganisationsTable.php index d4a99b9..4e77c99 100644 --- a/src/Model/Table/OrganisationsTable.php +++ b/src/Model/Table/OrganisationsTable.php @@ -21,6 +21,7 @@ class OrganisationsTable extends AppTable $this->addBehavior('Timestamp'); $this->addBehavior('Tags.Tag'); $this->addBehavior('AuditLog'); + $this->addBehavior('UUID'); $this->hasMany( 'Alignments', [ diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 37a76e1..6b92527 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -115,7 +115,6 @@ class UsersTable extends AppTable $this->Roles = TableRegistry::get('Roles'); $role = $this->Roles->newEntity([ 'name' => 'admin', - 'uuid' => Text::uuid(), 'perm_admin' => 1, 'perm_org_admin' => 1, 'perm_sync' => 1 @@ -123,21 +122,18 @@ class UsersTable extends AppTable $this->Roles->save($role); $this->Organisations = TableRegistry::get('Organisations'); $organisation = $this->Organisations->newEntity([ - 'name' => 'default_organisation', - 'uuid' => Text::uuid() + 'name' => 'default_organisation' ]); $this->Organisations->save($organisation); $this->Individuals = TableRegistry::get('Individuals'); $individual = $this->Individuals->newEntity([ 'email' => 'admin@admin.test', - 'uuid' => Text::uuid(), 'first_name' => 'admin', 'last_name' => 'admin' ]); $this->Individuals->save($individual); $user = $this->newEntity([ 'username' => 'admin', - 'uuid' => Text::uuid(), 'password' => 'Password1234', 'individual_id' => $individual->id, 'oganisation_id' => $organisation->id, From 94457d3b97b262e88513b4db8aedc01cc2a8c935 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:36:24 +0100 Subject: [PATCH 08/11] fix: [migration] userorg migration fixed --- config/Migrations/20211123152707_user_org.php | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/config/Migrations/20211123152707_user_org.php b/config/Migrations/20211123152707_user_org.php index f615c98..5543e98 100644 --- a/config/Migrations/20211123152707_user_org.php +++ b/config/Migrations/20211123152707_user_org.php @@ -1,7 +1,7 @@ hasTable('users'); - if (!$exists) { - $alignments = $this->table('users') - ->addColumn('organisation_id', 'integer', [ - 'default' => null, - 'null' => true, - 'signed' => false, - 'length' => 10 - ]) - ->addIndex('org_id') - ->update(); - } + $alignments = $this->table('users') + ->addColumn('organisation_id', 'integer', [ + 'default' => null, + 'null' => true, + 'signed' => false, + 'length' => 10 + ]) + ->addIndex('org_id') + ->update(); $q1 = $this->getQueryBuilder(); $org_id = $q1->select(['min(id)'])->from('organisations')->execute()->fetchAll()[0][0]; if (!empty($org_id)) { From b009191aa68f0320a174c5f5a719f6db323ee4b1 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:39:27 +0100 Subject: [PATCH 09/11] fix: [migrations] user org further fixes --- config/Migrations/20211123152707_user_org.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/Migrations/20211123152707_user_org.php b/config/Migrations/20211123152707_user_org.php index 5543e98..0c5bc7a 100644 --- a/config/Migrations/20211123152707_user_org.php +++ b/config/Migrations/20211123152707_user_org.php @@ -25,7 +25,7 @@ final class UserOrg extends AbstractMigration 'signed' => false, 'length' => 10 ]) - ->addIndex('org_id') + ->addIndex('organisation_id') ->update(); $q1 = $this->getQueryBuilder(); $org_id = $q1->select(['min(id)'])->from('organisations')->execute()->fetchAll()[0][0]; From c2cefb4311021ad24b280cc2d7784cb2fca82b81 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:59:34 +0100 Subject: [PATCH 10/11] fix: [user init] generation fixed --- src/Model/Entity/Organisation.php | 5 ----- src/Model/Table/OrganisationsTable.php | 6 +----- src/Model/Table/UsersTable.php | 3 ++- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Model/Entity/Organisation.php b/src/Model/Entity/Organisation.php index bc78378..6766963 100644 --- a/src/Model/Entity/Organisation.php +++ b/src/Model/Entity/Organisation.php @@ -10,10 +10,5 @@ class Organisation extends AppModel protected $_accessible = [ '*' => true, 'id' => false, - 'uuid' => false, - ]; - - protected $_accessibleOnNew = [ - 'uuid' => true, ]; } diff --git a/src/Model/Table/OrganisationsTable.php b/src/Model/Table/OrganisationsTable.php index 4e77c99..c56720e 100644 --- a/src/Model/Table/OrganisationsTable.php +++ b/src/Model/Table/OrganisationsTable.php @@ -11,17 +11,13 @@ class OrganisationsTable extends AppTable { public $metaFields = 'organisation'; - protected $_accessible = [ - 'id' => false - ]; - public function initialize(array $config): void { parent::initialize($config); + $this->addBehavior('UUID'); $this->addBehavior('Timestamp'); $this->addBehavior('Tags.Tag'); $this->addBehavior('AuditLog'); - $this->addBehavior('UUID'); $this->hasMany( 'Alignments', [ diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 6b92527..2eebd8c 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -122,7 +122,8 @@ class UsersTable extends AppTable $this->Roles->save($role); $this->Organisations = TableRegistry::get('Organisations'); $organisation = $this->Organisations->newEntity([ - 'name' => 'default_organisation' + 'name' => 'default_organisation', + 'uuid' => Text::uuid() ]); $this->Organisations->save($organisation); $this->Individuals = TableRegistry::get('Individuals'); From 033f6d7f97cefb5c7dd1aa3f1687172f90a50493 Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 25 Nov 2021 00:02:16 +0100 Subject: [PATCH 11/11] fix: [typo] organisations != oganisations --- src/Model/Table/UsersTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 2eebd8c..61f06b8 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -137,7 +137,7 @@ class UsersTable extends AppTable 'username' => 'admin', 'password' => 'Password1234', 'individual_id' => $individual->id, - 'oganisation_id' => $organisation->id, + 'organisation_id' => $organisation->id, 'role_id' => $role->id ]); $this->save($user);