diff --git a/db/model/Post.ts b/db/model/Post.ts index 737f4ba8ca2..6662b337e9d 100644 --- a/db/model/Post.ts +++ b/db/model/Post.ts @@ -160,7 +160,7 @@ export const getPostsFromSnapshots = async ( SELECT * FROM ${postsTable} WHERE status = "publish" AND type IN (?) - ORDER BY JSON_UNQUOTE(JSON_EXTRACT(wpApiSnapshot, '$.date')) DESC; + ORDER BY wpApiSnapshot->>'$.date' DESC; `, [postTypes] )