From cd1fc649e3a0cf4df9db2d046f07166e137ef789 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 27 Feb 2025 13:54:10 +0100 Subject: [PATCH] feat(database): Add index to scheduled task executions for improved query performance --- ...add_index_to_scheduled_task_executions.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2025_02_27_125249_add_index_to_scheduled_task_executions.php 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 000000000..e8033cfdc --- /dev/null +++ b/database/migrations/2025_02_27_125249_add_index_to_scheduled_task_executions.php @@ -0,0 +1,28 @@ +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'); + }); + } +};