/** * * Alters the table based on $this->col and $this->idx. * * @access public * * @return mixed Boolean true if altering was successful or a PEAR_Error on * failure. * * @see DB_Table_Manager::alter() * */ function alter() { $create = false; // alter the table columns and indexes if the table exists $table_exists = DB_Table_Manager::tableExists($this->db, $this->table); if (PEAR::isError($table_exists)) { return $table_exists; } if (!$table_exists) { // table does not exist => just create the table, there is // nothing that could be altered $create = true; } if ($create) { return DB_Table_Manager::create($this->db, $this->table, $this->col, $this->idx); } return DB_Table_Manager::alter($this->db, $this->table, $this->col, $this->idx); }