mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-09-18 23:38:02 +00:00
37 lines
930 B
PHP
37 lines
930 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class RemoveOldCompoundIndexFromStatusesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::table('statuses', function (Blueprint $table) {
|
|
$indexes = Schema::getIndexes('statuses');
|
|
$indexesFound = collect($indexes)->map(function($i) { return $i['name']; })->toArray();
|
|
if (in_array('statuses_in_reply_to_id_reblog_of_id_index', $indexesFound)) {
|
|
$table->dropIndex('statuses_in_reply_to_id_reblog_of_id_index');
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('statuses', function (Blueprint $table) {
|
|
//
|
|
});
|
|
}
|
|
}
|