Skip to content

A free open source IT asset/license management system

Adds a 'created_at' index to the models table

Brady Wetherington6db0003e3f0a
diff --git a/database/migrations/2025_08_20_190617_add_created_at_index_to_models.php b/database/migrations/2025_08_20_190617_add_created_at_index_to_models.php
new file mode 100644
index 0000000000..5a73a94f3b
--- /dev/null
+++ b/database/migrations/2025_08_20_190617_add_created_at_index_to_models.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('models', function (Blueprint $table) {
+ $table->index(['created_at']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('models', function (Blueprint $table) {
+ $table->dropIndex(['created_at']);
+ });
+ }
+};