feat(database): adjust trigger (fixes #4461)