Fixes #5833: The `message` command fails with a FK constraint error when trying to update messages