Merge "Minor tweaks to the sqlite upgrade script" into main