Explorar o código

Indices go up, not down

Mark Rousskov %!s(int64=5) %!d(string=hai) anos
pai
achega
58237075ac
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  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