Update migration to set the last index id (this needs testing next)