mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Migrations: Fix dropping foreign keys
Passing an array to dropForeign does not mean dropping multiple indices, but rather dropping a key on multiple tables. Passing a string means that this string will be interpreted as index name, not as name of the indexed column. Passing an array with one string is therefore correct, in order to benefit from automatic index name generation.
This commit is contained in:
parent
a54f1e2bc5
commit
732432d00b
|
@ -37,7 +37,8 @@ return [
|
|||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('post_likes', function (Blueprint $table) use ($schema) {
|
||||
$table->dropForeign(['post_id', 'user_id']);
|
||||
$table->dropForeign(['post_id']);
|
||||
$table->dropForeign(['user_id']);
|
||||
|
||||
Migration::fixIndexNames($schema, $table);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user