From 97b4887bc2cf9c52a9c89b7ddaf99219f72395bb Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 20 May 2023 06:26:52 +0400 Subject: [PATCH] Fixed GetAll query. --- pkg/mindflow/database/sqlite/queries/postGetAll.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/mindflow/database/sqlite/queries/postGetAll.sql b/pkg/mindflow/database/sqlite/queries/postGetAll.sql index 5616c2e..3662b10 100644 --- a/pkg/mindflow/database/sqlite/queries/postGetAll.sql +++ b/pkg/mindflow/database/sqlite/queries/postGetAll.sql @@ -1,10 +1,11 @@ SELECT `post`.`post_id`, - `category`.`id` AS `category_id`, + `category`.`category_id` AS `category_id`, `category`.`name` AS `category`, - `post`.`date`, + UNIXEPOCH(`post`.`date`), `post`.`title`, `post`.`body` FROM `post` LEFT JOIN `category` - ON `post`.`post_id` = `category`.`category_id`; \ No newline at end of file + ON `post`.`category_id` = `category`.`category_id` + ORDER BY `post`.`date` DESC; \ No newline at end of file