浏览代码

Indices go up, not down

Mark Rousskov 5 年之前
父节点
当前提交
58237075ac
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/db/notifications.rs

+ 4 - 4
src/db/notifications.rs

@@ -73,7 +73,7 @@ pub async fn delete_ping(
                     "select notification_id, idx, user_id
                     from notifications
                     where user_id = $1
-                    order by idx desc nulls last;",
+                    order by idx asc nulls last;",
                     &[&user_id],
                 )
                 .await
@@ -139,7 +139,7 @@ pub async fn move_indices(
                 "select notification_id, idx, user_id
         from notifications
         where user_id = $1
-        order by idx desc nulls last;",
+        order by idx asc nulls last;",
                 &[&user_id],
             )
             .await
@@ -216,7 +216,7 @@ pub async fn add_metadata(
                 "select notification_id, idx, user_id
         from notifications
         where user_id = $1
-        order by idx desc nulls last;",
+        order by idx asc nulls last;",
                 &[&user_id],
             )
             .await
@@ -271,7 +271,7 @@ pub async fn get_notifications(
         from notifications
         join users on notifications.user_id = users.user_id
         where username = $1
-        order by notifications.idx desc nulls last;",
+        order by notifications.idx asc nulls last;",
             &[&username],
         )
         .await