Skip to content

A free open source IT asset/license management system

Added compound index fro action_type and created_at

snipeb86db3f00b2a
diff --git a/database/migrations/2026_09_21_174908_add_action_type_created_at_composite_index_to_action_logs.php b/database/migrations/2026_09_21_174908_add_action_type_created_at_composite_index_to_action_logs.php
new file mode 100644
index 0000000000..c83ab31b76
--- /dev/null
+++ b/database/migrations/2026_09_21_174908_add_action_type_created_at_composite_index_to_action_logs.php
@@ -0,0 +1,28 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::table('action_logs', function (Blueprint $table) {
+ $table->index(['action_type', 'created_at']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('action_logs', function (Blueprint $table) {
+ $table->dropIndex(['action_type', 'created_at']);
+ });
+ }
+};