Model sql fix.