pixelfed/database/migrations/2022_10_07_055133_remove_old_compound_index_from_statuses_table.php
Daniel Supernault 4d1180b1c1
Fix migrations
2024-07-01 02:39:42 -06:00

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) {
//
});
}
}