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:
Franz Liedke 2018-11-30 14:04:12 +01:00
parent 2722a0f2c5
commit ae3d1f5f5f

@ -41,7 +41,8 @@ return [
'down' => function (Builder $schema) {
$schema->table('flags', function (Blueprint $table) use ($schema) {
$table->dropForeign(['post_id', 'user_id']);
$table->dropForeign(['post_id']);
$table->dropForeign(['user_id']);
Migration::fixIndexNames($schema, $table);
});