Completed
Pull Request — 3.x (#574)
by Oskar
01:31
created
src/Entity/CommentManager.php 2 patches
Doc Comments   -22 removed lines patch added patch discarded remove patch
@@ -133,25 +133,3 @@
 block discarded – undo
133 133
             case 'postgresql':
134 134
                 return sprintf(
135 135
                     <<<'SQL'
136
-UPDATE %s SET comments_count = count_comment.total
137
-FROM (SELECT c.post_id, count(*) AS total FROM %s AS c WHERE c.status = 1 GROUP BY c.post_id) count_comment
138
-WHERE %s.id = count_comment.post_id
139
-SQL,
140
-                    $postTableName,
141
-                    $commentTableName,
142
-                    $postTableName
143
-                );
144
-
145
-            default:
146
-                return sprintf(
147
-                    <<<'SQL'
148
-UPDATE %s p, (SELECT c.post_id, count(*) as total FROM %s as c WHERE c.status = 1 GROUP BY c.post_id) as count_comment
149
-SET p.comments_count = count_comment.total
150
-WHERE p.id = count_comment.post_id
151
-SQL,
152
-                    $postTableName,
153
-                    $commentTableName
154
-                );
155
-        }
156
-    }
157
-}
Please login to merge, or discard this patch.
Unused Use Statements   -22 removed lines patch added patch discarded remove patch
@@ -133,25 +133,3 @@
 block discarded – undo
133 133
             case 'postgresql':
134 134
                 return sprintf(
135 135
                     <<<'SQL'
136
-UPDATE %s SET comments_count = count_comment.total
137
-FROM (SELECT c.post_id, count(*) AS total FROM %s AS c WHERE c.status = 1 GROUP BY c.post_id) count_comment
138
-WHERE %s.id = count_comment.post_id
139
-SQL,
140
-                    $postTableName,
141
-                    $commentTableName,
142
-                    $postTableName
143
-                );
144
-
145
-            default:
146
-                return sprintf(
147
-                    <<<'SQL'
148
-UPDATE %s p, (SELECT c.post_id, count(*) as total FROM %s as c WHERE c.status = 1 GROUP BY c.post_id) as count_comment
149
-SET p.comments_count = count_comment.total
150
-WHERE p.id = count_comment.post_id
151
-SQL,
152
-                    $postTableName,
153
-                    $commentTableName
154
-                );
155
-        }
156
-    }
157
-}
Please login to merge, or discard this patch.