Everything back to normal - correct balance updated at the end of the sync!
Great news!
It's the 3rd time I get the database corrupt though, is there anything that can be done as a maintenance to prevent this? Or is it due to the fact that I keep it on external hdd and sometimes that happens? With that plug/unplug devices, etc
I'm 99% sure that the issue is caused by the external HDD.
Two things to start with would be:
1. After closing Bitcoin wallet, check with task manager it was indeed closed (check, but not kill).
2. Use the "safely eject" functionality and wait for "it's now safe to" before unplugging.
Maybe some will hate me for this advice, but if you don't need Bitcoin core wallet, maybe you could use a SPV wallet (Electrum), or at lest use Bitcoin wallet in pruned mode (much smaller blockchain), on the internal HDD.
I think that you can also set in your system for external HDD (or USBs) to make it safer for unplugging, but I expect that'll make the data transfer much slower (and not sure how it can be done).