forge
Explore
Log in

Don't you dare go Hollow

NULLS LAST on nullable stamp orderings (Gamze's find)

Browse files at this commit

914d095f7fa0ebf0c3565bfc15c983bb719c19f2Ahmet Kaan GümüşParent: 995dab7
  • fix
    • NULLS LAST on nullable stamp orderings (Gamze's find)
Show full message
🐛 fix: NULLS LAST on nullable stamp orderings (Gamze's find)
src/db/class_course.rsmodified+1 -1
@@ -51,7 +51,7 @@ pub async fn list_for_class(
5151 ) -> Result<(Vec<ClassCourse>, i64), AppError> {
5252 PagedList::new(
5353 format!("{CLASS_COURSE_TABLE} WHERE class = $1"),
54- "ORDER BY attached_at DESC, class DESC, course DESC",
54+ "ORDER BY attached_at DESC NULLS LAST, class DESC, course DESC",
5555 )
5656 .bind(class.uuid())
5757 .run(limit, offset, db)
src/db/class_member.rsmodified+2 -2
@@ -22,7 +22,7 @@ pub async fn list_for_class(
2222 ) -> Result<(Vec<ClassMember>, i64), AppError> {
2323 PagedList::new(
2424 format!("{CLASS_MEMBER_TABLE} WHERE class = $1"),
25- "ORDER BY added_at DESC, class DESC, app_user DESC",
25+ "ORDER BY added_at DESC NULLS LAST, class DESC, app_user DESC",
2626 )
2727 .bind(class.uuid())
2828 .run(limit, offset, db)
@@ -40,7 +40,7 @@ pub async fn list_for_user(
4040 ) -> Result<(Vec<ClassMember>, i64), AppError> {
4141 PagedList::new(
4242 format!("{CLASS_MEMBER_TABLE} WHERE app_user = $1"),
43- "ORDER BY added_at DESC, class DESC, app_user DESC",
43+ "ORDER BY added_at DESC NULLS LAST, class DESC, app_user DESC",
4444 )
4545 .bind(user.uuid())
4646 .run(limit, offset, db)