summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/db/bundb/relationship.go8
-rw-r--r--internal/federation/federatingdb/following_test.go4
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/db/bundb/relationship.go b/internal/db/bundb/relationship.go
index 30e3850d2..1c533af39 100644
--- a/internal/db/bundb/relationship.go
+++ b/internal/db/bundb/relationship.go
@@ -331,7 +331,7 @@ func newSelectFollows(db *bun.DB, accountID string) *bun.SelectQuery {
Table("follows").
Column("id").
Where("? = ?", bun.Ident("account_id"), accountID).
- OrderExpr("? DESC", bun.Ident("id"))
+ OrderExpr("? DESC", bun.Ident("created_at"))
}
// newSelectLocalFollows returns a new select query for all rows in the follows table with
@@ -349,7 +349,7 @@ func newSelectLocalFollows(db *bun.DB, accountID string) *bun.SelectQuery {
Column("id").
Where("? IS NULL", bun.Ident("domain")),
).
- OrderExpr("? DESC", bun.Ident("id"))
+ OrderExpr("? DESC", bun.Ident("created_at"))
}
// newSelectFollowers returns a new select query for all rows in the follows table with target_account_id = accountID.
@@ -358,7 +358,7 @@ func newSelectFollowers(db *bun.DB, accountID string) *bun.SelectQuery {
Table("follows").
Column("id").
Where("? = ?", bun.Ident("target_account_id"), accountID).
- OrderExpr("? DESC", bun.Ident("id"))
+ OrderExpr("? DESC", bun.Ident("created_at"))
}
// newSelectLocalFollowers returns a new select query for all rows in the follows table with
@@ -376,7 +376,7 @@ func newSelectLocalFollowers(db *bun.DB, accountID string) *bun.SelectQuery {
Column("id").
Where("? IS NULL", bun.Ident("domain")),
).
- OrderExpr("? DESC", bun.Ident("id"))
+ OrderExpr("? DESC", bun.Ident("created_at"))
}
// newSelectBlocks returns a new select query for all rows in the blocks table with account_id = accountID.
diff --git a/internal/federation/federatingdb/following_test.go b/internal/federation/federatingdb/following_test.go
index 93bc6d348..83d1a72b5 100644
--- a/internal/federation/federatingdb/following_test.go
+++ b/internal/federation/federatingdb/following_test.go
@@ -47,8 +47,8 @@ func (suite *FollowingTestSuite) TestGetFollowing() {
suite.Equal(`{
"@context": "https://www.w3.org/ns/activitystreams",
"items": [
- "http://localhost:8080/users/1happyturtle",
- "http://localhost:8080/users/admin"
+ "http://localhost:8080/users/admin",
+ "http://localhost:8080/users/1happyturtle"
],
"type": "Collection"
}`, string(fJson))