From 0331e3ce4e91db06ff735adf4984cc5d0ffb2dd2 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 3 Sep 2024 22:43:34 +0530 Subject: [PATCH] Sory users by `created_at` always. --- queries.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/queries.sql b/queries.sql index a1c05c59..ddf5d02f 100644 --- a/queries.sql +++ b/queries.sql @@ -1083,7 +1083,8 @@ UPDATE users SET WHEN $9 > 0 THEN (SELECT id FROM roles WHERE id = $9 AND type = 'list') ELSE list_role_id END ), - status=(CASE WHEN $10 != '' THEN $10::user_status ELSE status END) + status=(CASE WHEN $10 != '' THEN $10::user_status ELSE status END), + updated_at=NOW() WHERE id=$1 AND (SELECT canEdit FROM u) = TRUE; -- name: delete-users @@ -1136,7 +1137,8 @@ FROM users WHEN $3::TEXT != '' THEN email = $3 ELSE TRUE END - ); + ) + ORDER BY users.created_at; -- name: get-api-tokens