create index migration for transactions table

This commit is contained in:
edmondlang
2023-12-18 23:10:33 +08:00
parent 1ddf7923a5
commit a4489215c2
@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIndexForTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('transactions', function (Blueprint $table) {
$table->index('status');
$table->index('type');
$table->index('payment_method');
$table->index('payment_reference');
$table->index('bill_no');
$table->index('owner_type');
$table->index('owner_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transactions', function (Blueprint $table) {
$table->dropIndex('status');
$table->dropIndex('type');
$table->dropIndex('payment_method');
$table->dropIndex('payment_reference');
$table->dropIndex('bill_no');
$table->dropIndex('owner_type');
$table->dropIndex('owner_id');
});
}
}