From 5c7eef001a45eb147a4fa1e31e44d55670d6c796 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 16 Apr 2024 17:36:10 +0000 Subject: [PATCH] Bugfix/fix voice call active text --- .../VoiceCallHistoryModel.php | 2 +- ...300_add_voice_call_history_start_index.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 db/migrations/20240416190300_add_voice_call_history_start_index.php diff --git a/application/VoiceCallHistory/VoiceCallHistoryModel.php b/application/VoiceCallHistory/VoiceCallHistoryModel.php index 474a6b5cd..0e26604d3 100644 --- a/application/VoiceCallHistory/VoiceCallHistoryModel.php +++ b/application/VoiceCallHistory/VoiceCallHistoryModel.php @@ -117,7 +117,7 @@ class VoiceCallHistoryModel { $sql .= isset($filters['billable']) ? self::generateFilterCondition($filters['billable'], "billable") : ""; $sql .= isset($filters['duration']) ? self::generateFilterCondition($filters['duration'], "duration") : ""; - return $sql; + return $sql . " ORDER BY `start` DESC"; } public static function getVoiceCallHistory($filters, $limit = null, $offset = 0): array { diff --git a/db/migrations/20240416190300_add_voice_call_history_start_index.php b/db/migrations/20240416190300_add_voice_call_history_start_index.php new file mode 100644 index 000000000..94b68e050 --- /dev/null +++ b/db/migrations/20240416190300_add_voice_call_history_start_index.php @@ -0,0 +1,19 @@ +getEnvironment() == "thetool") { + //VoiceCallHistory Table add start index + $this->table("VoiceCallHistory")->addIndex(["start"]); + } + } + + public function down(): void { + if ($this->getEnvironment() == "thetool") { + $this->table("VoiceCallHistory")->removeIndex(["start"]); + } + } +}