Update postgres schema with improved triggers