Ruckusing_Adapter_Sqlite3_Base::remove_index PHP Method

remove_index() public method

public remove_index ( string $table_name, string $column_name, array $options = [] ) : boolean
$table_name string
$column_name string
$options array
return boolean
    public function remove_index($table_name, $column_name, $options = array())
    {
        if (empty($table_name)) {
            throw new Ruckusing_Exception("Missing table name parameter", Ruckusing_Exception::INVALID_ARGUMENT);
        }
        if (empty($column_name)) {
            throw new Ruckusing_Exception("Missing column name parameter", Ruckusing_Exception::INVALID_ARGUMENT);
        }
        //did the user specify an index name?
        if (is_array($options) && array_key_exists('name', $options)) {
            $index_name = $options['name'];
        } else {
            $index_name = Ruckusing_Util_Naming::index_name($table_name, $column_name);
        }
        $sql = sprintf("DROP INDEX %s", $this->quote_column_name($index_name));
        return $this->execute_ddl($sql);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Remove an index
  *
  * @param string $table_name the name of the table
  * @param string $column_name the column name
  * @param array|string $options
  *
  * @return boolean
  */
 public function remove_index($table_name, $column_name, $options = array())
 {
     return $this->_adapter->remove_index($table_name, $column_name, $options);
 }