Fixes #6038: correct migration script for insertion id