Adjusting the Invoice Template

It looks like you run the after migration query of Migration from 5.8 to 6.0
So now you have lost the data which prevent a clean upgrade.