mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 17:02:41 +01:00
5d1359d78f
Summary: Fixes T11705. I did not realize that `ON DUPLICATE KEY UPDATE` was order-dependent, so the "reset" clause of this `IF(...)` never actually worked. Reorder it so we check if we're changing the message type //first//, then actually change the message type. This makes the count reset properly when a failing repository succeeds, or a working repository fails. Test Plan: - On `master`, forced a working repository to fail a `bin/repository update`, saw the message change types (expected) but keep the old count (wrong!). - With this patch, repeated the process and saw the count reset properly. - Ran the patch, verified counts reset to 0. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11705 Differential Revision: https://secure.phabricator.com/D16623
4 lines
183 B
SQL
4 lines
183 B
SQL
/* Reset message counts to fix the bug in T11705 which caused some of them to
|
|
become very large. */
|
|
UPDATE {$NAMESPACE}_repository.repository_statusmessage
|
|
SET messageCount = 0;
|