Implemented preconditions for key constraints