mirror of
https://github.com/flarum/core.git
synced 2025-08-30 11:30:21 +02:00
Fix index names in migrations
This can be reverted when we upgrade to Laravel 5.7.
This commit is contained in:
@@ -9,12 +9,13 @@
|
||||
* 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('last_posted_at');
|
||||
$table->index('last_posted_user_id');
|
||||
$table->index('created_at');
|
||||
@@ -22,11 +23,13 @@ return [
|
||||
$table->index('comment_count');
|
||||
$table->index('participant_count');
|
||||
$table->index('hidden_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(['last_posted_at']);
|
||||
$table->dropIndex(['last_posted_user_id']);
|
||||
$table->dropIndex(['created_at']);
|
||||
@@ -34,6 +37,8 @@ return [
|
||||
$table->dropIndex(['comment_count']);
|
||||
$table->dropIndex(['participant_count']);
|
||||
$table->dropIndex(['hidden_at']);
|
||||
|
||||
Migration::fixIndexNames($schema, $table);
|
||||
});
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user