Patch composite_primary_keys to work around issue when one component of