Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(database): Add index to scheduled task executions for improved query performance

Andras Bacsaicd1fc649e3a0
diff --git a/database/migrations/2025_02_27_125249_add_index_to_scheduled_task_executions.php b/database/migrations/2025_02_27_125249_add_index_to_scheduled_task_executions.php
new file mode 100644
index 0000000000..e8033cfdc3
--- /dev/null
+++ b/database/migrations/2025_02_27_125249_add_index_to_scheduled_task_executions.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('scheduled_task_executions', function (Blueprint $table) {
+ $table->index(['scheduled_task_id', 'created_at'], 'scheduled_task_executions_task_id_created_at_index');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('scheduled_task_executions', function (Blueprint $table) {
+ $table->dropIndex('scheduled_task_executions_task_id_created_at_index');
+ });
+ }
+};