-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7942 from cakephp/countercache-command
Countercache command
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CounterCache Tool | ||
################# | ||
|
||
The CounterCacheCommand provides a CLI tool for rebuilding the counter caches | ||
in your application and plugin models. It can be used in maintenance and | ||
recovery operations, or to populate new counter caches added to your | ||
application. | ||
|
||
.. code-block:: console | ||
bin/cake counter_cache --assoc Comments Articles | ||
This would rebuild the ``Comments`` related counters on the ``Articles`` table. | ||
For very large tables you may need to rebuild counters in batches. You can use | ||
the ``--limit`` and ``--page`` options to incrementally rebuild counter state. | ||
|
||
.. code-block:: console | ||
bin/cake counter_cache --assoc Comments --limit 100 --page 2 Articles | ||
When ``limit`` and ``page`` are used, records will be ordered by the table's | ||
primary key. | ||
|
||
.. versionadded:: 5.2.0 |