protected function checkIndex($index, $should_be, $good_def) { $pu = $this->db->indexAttributes($index); if (!empty($pu) && $pu != $should_be) { $this->output("Dropping obsolete version of index '{$index}'\n"); $this->db->query("DROP INDEX \"" . $index . "\""); $pu = array(); } else { $this->output("...no need to drop index '{$index}'\n"); } if (empty($pu)) { $this->output("Creating index '{$index}'\n"); $this->db->query($good_def); } else { $this->output("...index '{$index}' exists\n"); } }