-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I get this output when running the migration rollback command. But the up method works fine, and creates the index as expected. It's rolling back(dropping the index that's the issue).
This is the migration file content:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductFacetsIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('productsdb')->table('products', function (Blueprint $collection) {
$collection->index(
[
"facets.name" => 1,
"facets.value" => 1,
],
'facets_index',
null,
['name' => 'facets_index']
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('productsdb')->table('products', function (Blueprint $collection) {
$collection->dropIndex(['facets_index']);
});
}
}
I think this is a bug. Looking at the code, I see that '_1' is always appended to the index name when the dropIndex method is called.
Metadata
Metadata
Assignees
Labels
No labels