function addCheckConstraint($table, $definition, $name = '') { $f_schema = $this->_schema; $this->fieldClean($f_schema); $this->fieldClean($table); $this->fieldClean($name); // @@ How the heck do you clean a definition??? $sql = "ALTER TABLE \"{$f_schema}\".\"{$table}\" ADD "; if ($name != '') { $sql .= "CONSTRAINT \"{$name}\" "; } $sql .= "CHECK ({$definition})"; return $this->execute($sql); }