Pārlūkot izejas kodu

Do not overwrite idx when setting metadata

Since the index in the table is 1-based and the index we were setting is
0-based, this would write the wrong index. Also, we should not adjust the
position (and as such the index) when updating the metadata column.
Mark Rousskov 5 gadi atpakaļ
vecāks
revīzija
a95aa98b6d
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      src/db/notifications.rs

+ 2 - 2
src/db/notifications.rs

@@ -234,9 +234,9 @@ pub async fn add_metadata(
             ),
             Some(id) => {
                 t.execute(
-                    "update notifications SET idx = $2, metadata = $3
+                    "update notifications SET metadata = $3
                  where notification_id = $1",
-                    &[&id, &(idx as i32), &metadata],
+                    &[&id, &metadata],
                 )
                 .await
                 .context("update notification id")?;