diff --git a/database/migrations/2024_10_15_044532_add_index_to_transactions.php b/database/migrations/2024_10_15_044532_add_index_to_transactions.php new file mode 100644 index 00000000..531f857f --- /dev/null +++ b/database/migrations/2024_10_15_044532_add_index_to_transactions.php @@ -0,0 +1,34 @@ +index(['owner_id', 'owner_type', 'created_at', 'status'], 'idx_transactions_owner_date_status'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('transactions', function (Blueprint $table) { + // Drop the index + $table->dropIndex('idx_transactions_owner_date_status'); + }); + } +}