fix: [migration:user_org] Fixed if org_id column does not exist
parent
e8e1a16673
commit
999f4c8539
|
@ -18,16 +18,16 @@ final class UserOrg extends AbstractMigration
|
||||||
*/
|
*/
|
||||||
public function change(): void
|
public function change(): void
|
||||||
{
|
{
|
||||||
$exists = $this->hasTable('users');
|
$exists = $this->table('users')->hasColumn('organisation_id');
|
||||||
if (!$exists) {
|
if (!$exists) {
|
||||||
$alignments = $this->table('users')
|
$this->table('users')
|
||||||
->addColumn('organisation_id', 'integer', [
|
->addColumn('organisation_id', 'integer', [
|
||||||
'default' => null,
|
'default' => null,
|
||||||
'null' => true,
|
'null' => true,
|
||||||
'signed' => false,
|
'signed' => false,
|
||||||
'length' => 10
|
'length' => 10
|
||||||
])
|
])
|
||||||
->addIndex('org_id')
|
->addIndex('organisation_id')
|
||||||
->update();
|
->update();
|
||||||
}
|
}
|
||||||
$q1 = $this->getQueryBuilder();
|
$q1 = $this->getQueryBuilder();
|
||||||
|
|
Loading…
Reference in New Issue