Commit graph

9 commits

Author SHA1 Message Date
Daimona Eaytoy 9d8e004972 fixOldLogEntries: don't pass empty lists to Database::makeList
This made the script fail at a later stage, although it didn't cause any
harm.

Bug: T228655
Change-Id: I0c983cb4b5a262e81372fbd23f893ffb176eb9b5
2020-02-10 17:24:18 +01:00
Daimona Eaytoy d79970ef38 fixOldLogEntries: Add missing pairs of parentheses
Bug: T228655
Change-Id: I3bdb7e9efc8e12b055ba37440f1197fe6ed3b69d
2020-02-08 15:18:52 +01:00
Daimona Eaytoy 54512dd124 Fix more inconsistencies in scripts for logging entries
This includes a bunch of improvements.

In addMissingLoggingEntries:
 - Don't access mDescription directly
 - Build a ManualLogEntry instead of stuffing data in the DB

In fixOldLogEntries:
 - Fix entries having log_page = NULL instead of 0 due to
 addMissingLoggingEntries skipping that field
 - Fix entries having log_deleted = afh_deleted caused by
 addMissingLoggingEntries -- those are completely unrelated
 - Add batching, controlled by log_id, with default size of 500
 - Use Database::strreplace to have a single UPDATE per batch, instead
 of one per row.
 - In dry run, when checking rows to update, exclude the rows that
 would've been deleted in the first phase.

Bug: T228655
Change-Id: I885dba3f0772633d843b8a55e483047b169dc9ba
2020-02-03 15:30:07 +00:00
Daimona Eaytoy 395bb9c7e7 Fix silly bug in fixOldLogEntries
If there are no faulty entries, exit early instead of running a query
with 'log_params' => [], which would throw an exception.

Bug: T228655
Change-Id: I6a0f0439d1f3e18f90075a36894f02090cac9202
2019-12-16 17:26:15 +00:00
Daimona Eaytoy 2755685b5c Update fixOldLogEntries
Make it also delete duplicated rows created by addMissingLoggingEntries.

Bug: T228655
Bug: T208931
Change-Id: I0e294d75e06592440773f224ef6aef172b8b9eba
2019-12-03 17:57:33 +00:00
Umherirrender cd4e0a5968 Use Maintenance::addDescription
It is better to use a setter function than setting a property

Change-Id: I64c133f00ea12cc5ba787c83ad3dee5f996baf15
2019-08-19 18:53:57 +02:00
Daimona Eaytoy 1860b4ca5a fixOldLogEntries: Don't print an extra line
Bug: T228655
Change-Id: Idce1f121e468ce0ac0720951f28613e6cc564113
2019-07-24 11:23:28 +00:00
Daimona Eaytoy 40ebf9ad6d Aesthetic changes for fixOldLogEntries script
Bug: T228655
Change-Id: Ic94a32ec906eb49db85c96212718bb3cf03f86af
2019-07-23 13:21:00 +00:00
Daimona Eaytoy 07e5168eb9 Add a maintenance script to fix broken log entries
A very simple fix for some old entries imploded with '\n' instead of
"\n". As for other scripts, this extends LoggedUpdateMaintenance but it
includes a dry run option to be tested, and a subsequent patch (to be
merged after testing) will add it to update.php.

Bug: T208931
Change-Id: I16d629c05c3b9c9055c68dafd261b0a5c0db9c25
2019-07-15 11:59:45 +00:00