Fixed #22777: Add dependency on through for autodetected M2M adds