From a4489215c20b5ea39b40f65b7cb1773e455fca0e Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 18 Dec 2023 23:10:33 +0800 Subject: [PATCH] create index migration for transactions table --- ...408_create_index_for_transaction_table.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 database/migrations/2023_12_18_230408_create_index_for_transaction_table.php diff --git a/database/migrations/2023_12_18_230408_create_index_for_transaction_table.php b/database/migrations/2023_12_18_230408_create_index_for_transaction_table.php new file mode 100644 index 00000000..3dc38456 --- /dev/null +++ b/database/migrations/2023_12_18_230408_create_index_for_transaction_table.php @@ -0,0 +1,44 @@ +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'); + }); + } +}