mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-29 22:56:37 -04:00
db: build the comments count column
This commit is contained in:
10
db/20180923004309-comment-count-build.sql
Normal file
10
db/20180923004309-comment-count-build.sql
Normal file
@ -0,0 +1,10 @@
|
||||
-- Build the comments count column
|
||||
|
||||
UPDATE pages
|
||||
SET commentCount = subquery.commentCount
|
||||
FROM (
|
||||
SELECT COUNT(commentHex) as commentCount
|
||||
FROM comments
|
||||
WHERE state = 'approved'
|
||||
GROUP BY (domain, path)
|
||||
) as subquery;
|
Reference in New Issue
Block a user