Fixes MySQL migrations and brings them up to speed.
Created by: PJB3005
Fixes #8596 (closed)
This essentially reverts #7891 too, because it broke log_client_to_db()
, but nobody ever realized because it never hit the server due to a secret repo conflict.
By the way the Secret repo conflict is purely copying the older code from the secret repo, so it's not actually conflicting.