Skip to content

Commit

Permalink
refactor: use mysql json shorthand accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbrgl committed Feb 18, 2024
1 parent 5e2ea61 commit 85cf4fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/model/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand Down

0 comments on commit 85cf4fe

Please sign in to comment.