From 94457d3b97b262e88513b4db8aedc01cc2a8c935 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Nov 2021 23:36:24 +0100 Subject: [PATCH] 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)) {