repo stats tables: fix migration to only update function
Created by: mrnugget
I assumed that I had to drop&recreate the trigger, but testing confirms
that I only need to CREATE OR REPLACE FUNCTION
for the new code to be
executed.
I also added tests to confirm this behaviour.
Test plan
- Test script here to check whether this is the behaviour: https://gist.github.com/mrnugget/627952cfeeceeb1fdc38fe523d5d1edc
- These tests