MDL-68683 core: fix DML exception on upgrade step