1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00
phorge-phorge/resources/sql
epriestley 5d1359d78f Fix an issue where repository message counts would never reset
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
2016-09-28 15:02:26 -07:00
..
autopatches Fix an issue where repository message counts would never reset 2016-09-28 15:02:26 -07:00
patches Modularize application transactions in Paste, mostly 2016-06-14 06:13:28 -07:00
quickstart.sql Update quickstart.sql 2016-06-24 14:49:03 -07:00
stopwords.txt Provide a setup warning about using the default MySQL stopword file 2014-08-13 15:34:09 -07:00