Solar_Sql_Adapter::addColumn PHP Méthode

addColumn() public méthode

The $info parameter should be in this format ... {{code: php $info = array( 'type' => (string) bool, char, int, ... 'size' => (int) total length for char|varchar|numeric 'scope' => (int) decimal places for numeric 'default' => (bool) the default value, if any 'require' => (bool) is the value required to be NOT NULL? 'primary' => (bool) is this a primary key column? 'autoinc' => (bool) is this an auto-increment column? ); }}
public addColumn ( string $table, string $name, array $info ) : mixed
$table string The table name (1-30 chars).
$name string The column name to add (1-28 chars).
$info array Information about the column.
Résultat mixed
    public function addColumn($table, $name, $info)
    {
        $this->_cache->deleteAll();
        $coldef = $this->_sqlColdef($name, $info);
        $table = $this->quoteName($table);
        $stmt = "ALTER TABLE {$table} ADD COLUMN {$coldef}";
        return $this->query($stmt);
    }