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"]); + } + } +}