From d497e65d211998a8c43009afdb0c55a7c2b4450d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 27 Nov 2018 22:34:00 +1030 Subject: [PATCH] Fix index names in migrations This can be reverted when we upgrade to Laravel 5.7. --- .../2018_09_15_043621_add_discussions_indices.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/migrations/2018_09_15_043621_add_discussions_indices.php b/extensions/sticky/migrations/2018_09_15_043621_add_discussions_indices.php index 315c35333..7d0fc3f31 100644 --- a/extensions/sticky/migrations/2018_09_15_043621_add_discussions_indices.php +++ b/extensions/sticky/migrations/2018_09_15_043621_add_discussions_indices.php @@ -9,19 +9,24 @@ * file that was distributed with this source code. */ +use Flarum\Database\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Builder; return [ 'up' => function (Builder $schema) { - $schema->table('discussions', function (Blueprint $table) { + $schema->table('discussions', function (Blueprint $table) use ($schema) { $table->index(['is_sticky', 'created_at']); + + Migration::fixIndexNames($schema, $table); }); }, 'down' => function (Builder $schema) { - $schema->table('discussions', function (Blueprint $table) { + $schema->table('discussions', function (Blueprint $table) use ($schema) { $table->dropIndex(['is_sticky', 'created_at']); + + Migration::fixIndexNames($schema, $table); }); } ];