tweaked SQL in restatement constraints