mirror of
https://github.com/humhub/humhub.git
synced 2025-02-22 18:22:43 +01:00
#4586 corrected migration - delete foreign key.
This commit is contained in:
parent
c01dda1896
commit
4ab82a8aa0
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
use humhub\components\Migration;
|
||||
|
||||
|
||||
/**
|
||||
* Class m201025_095247_spaces_of_users_group
|
||||
@ -37,8 +38,12 @@ class m201025_095247_spaces_of_users_group extends Migration
|
||||
]);
|
||||
}
|
||||
|
||||
$this->dropColumn('group', 'space_id');
|
||||
try {
|
||||
$this->dropForeignKey('fk_group-space_id', 'group');
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->safeDropColumn('group', 'space_id');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,6 +51,8 @@ class m201025_095247_spaces_of_users_group extends Migration
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->addColumn('group', 'space_id', $this->integer(10)->defaultValue(null));
|
||||
$this->addForeignKey('fk_group-space_id', 'group', 'space_id', 'space', 'id', 'CASCADE', 'CASCADE');
|
||||
$this->dropTable('group_space');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user