From 95d01f3136b702b82c0fe8cbf8d2207fb67041a4 Mon Sep 17 00:00:00 2001
From: Franz Liedke <franz@develophp.org>
Date: Sun, 3 Feb 2019 20:51:10 +0100
Subject: [PATCH] Depend on Laravel 5.7 for correct index names

---
 ...102300_change_post_mentions_post_add_foreign_keys.php | 9 ++-------
 ...102500_change_post_mentions_user_add_foreign_keys.php | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/extensions/mentions/migrations/2018_06_27_102300_change_post_mentions_post_add_foreign_keys.php b/extensions/mentions/migrations/2018_06_27_102300_change_post_mentions_post_add_foreign_keys.php
index 8018523a2..ccf8e09c2 100644
--- a/extensions/mentions/migrations/2018_06_27_102300_change_post_mentions_post_add_foreign_keys.php
+++ b/extensions/mentions/migrations/2018_06_27_102300_change_post_mentions_post_add_foreign_keys.php
@@ -9,7 +9,6 @@
  * file that was distributed with this source code.
  */
 
-use Flarum\Database\Migration;
 use Illuminate\Database\Schema\Blueprint;
 use Illuminate\Database\Schema\Builder;
 
@@ -27,20 +26,16 @@ return [
             })
             ->delete();
 
-        $schema->table('post_mentions_post', function (Blueprint $table) use ($schema) {
+        $schema->table('post_mentions_post', function (Blueprint $table) {
             $table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
             $table->foreign('mentions_post_id')->references('id')->on('posts')->onDelete('cascade');
-
-            Migration::fixIndexNames($schema, $table);
         });
     },
 
     'down' => function (Builder $schema) {
-        $schema->table('posts_mentions_posts', function (Blueprint $table) use ($schema) {
+        $schema->table('posts_mentions_posts', function (Blueprint $table) {
             $table->dropForeign(['post_id']);
             $table->dropForeign(['mentions_post_id']);
-
-            Migration::fixIndexNames($schema, $table);
         });
     }
 ];
diff --git a/extensions/mentions/migrations/2018_06_27_102500_change_post_mentions_user_add_foreign_keys.php b/extensions/mentions/migrations/2018_06_27_102500_change_post_mentions_user_add_foreign_keys.php
index 339fae43f..829e1b0df 100644
--- a/extensions/mentions/migrations/2018_06_27_102500_change_post_mentions_user_add_foreign_keys.php
+++ b/extensions/mentions/migrations/2018_06_27_102500_change_post_mentions_user_add_foreign_keys.php
@@ -9,7 +9,6 @@
  * file that was distributed with this source code.
  */
 
-use Flarum\Database\Migration;
 use Illuminate\Database\Schema\Blueprint;
 use Illuminate\Database\Schema\Builder;
 
@@ -27,20 +26,16 @@ return [
             })
             ->delete();
 
-        $schema->table('post_mentions_user', function (Blueprint $table) use ($schema) {
+        $schema->table('post_mentions_user', function (Blueprint $table) {
             $table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
             $table->foreign('mentions_user_id')->references('id')->on('users')->onDelete('cascade');
-
-            Migration::fixIndexNames($schema, $table);
         });
     },
 
     'down' => function (Builder $schema) {
-        $schema->table('post_mentions_user', function (Blueprint $table) use ($schema) {
+        $schema->table('post_mentions_user', function (Blueprint $table) {
             $table->dropForeign(['post_id']);
             $table->dropForeign(['mentions_user_id']);
-
-            Migration::fixIndexNames($schema, $table);
         });
     }
 ];