addColumn

@param string $name
@param string $type
@param bool   $signed
@param bool   $allowNull
@param string $default
@param string $comment
@param array  $options

@return  static
326396
public function addColumn(
        $name,
        $type = 'text',
        $signed = true,
        $allowNull = true,
        $default = '',
        $comment = '',
        $options = []
    ) {
        $column = $name;

        if (!($column instanceof Column)) {
            $column = new Column($name, $type, $signed, $allowNull, $default, $comment, $options);
        }

        if ($this->hasColumn($column->getName())) {
            return $this;
        }

        $this->prepareColumn($column);

        $query = PostgresqlGrammar::addColumn(
            $this->getName(),
            $column->getName(),
            $column->getType() . $column->getLength(),
            $column->getAllowNull(),
            $column->getDefault()
        );

        $this->db->setQuery($query)->execute();

        if ($column->getComment()) {
            $query = PostgresqlGrammar::comment('COLUMN', $this->getName(), $column->getName(), $column->getComment());
            $this->db->setQuery($query)->execute();
        }

        return $this->reset();
    }
427877
public function addColumnStatus($key, $name, $column = null)
	{
		$this->addColumnCheck($key);
		$column = $column ?: $key;

		return $this->addColumn($key, new Column\ColumnStatus($this, $key, $column, $name));
	}
972864
protected function addIndex($name, $type, $column)
    {
        if (isset($this->indexes[$name])) {
            $this->indexes[$name]['columns'][] = $column;
        }
        else {
            $this->indexes[$name] = [
                'name' => $name,
                'type' => $type,
                'columns' => [
                    $column
                ]
            ];
        }
    }
555829
public function addColumn($name, $type, $size = false) {
        return $this->table ? $this->table->column($name, $type, $size) : false;
    }
907164
public function addSimpleParameter(string $name, string $type = null, $defaultValue = null) {
		$parameter = new PhpParameter($name);
		$parameter->setType($type);

		if (2 < func_num_args()) {
			$parameter->setValue($defaultValue);
		}

		$this->addParameter($parameter);
		return $this;
	}
1193052
public function property( $name, $default = null, $comment = null, $export = true )
	{
		if ( $default !== null )
		{
			if ( $export )
			{
				$default = var_export( $default, true );
			}
		} 
		
		return $this->add( ( $comment ? static::make( 'comment', array( $comment ) )."\n" : '' ).
			$name.( $default !== null ? ' = '. $default : '' ).';' );
	}
1372004
public function addSql($name, $type = self::SQL_START, $value = '') {
        if ($this->_enabled == true) {
            switch ($type) {
                case self::SQL_START:
                    if (isset($this->_sql[$name])) {
                        $this->_lastSql = $name;
                    }
                    else {
                        $this->_lastSql = $name . rand(0, 10);
                    }

                    $this->_sql[$this->_lastSql] = [];
                    $this->_sql[$this->_lastSql]['time'] = microtime(true);
                    break;

                case self::SQL_END:
                    $this->_sql[$this->_lastSql]['time'] = round((microtime(true) - $this->_sql[$this->_lastSql]['time']) * 1000, 4);
                    $this->_sql[$this->_lastSql]['query'] = $value;
                    break;
            }
        }
    }
1257189
public function addColumn($type, $column, array $parameters = array())
	{
		// check against existing
		if(!$this->builder->hasColumn($this->table, $column))
			return parent::addColumn($type, $column, $parameters);

		// else probably compare and do some alteration
	}
604256
public function addColumn($column, $type, $table = null)
    {
        return $this->db->alterTable($this->getTable($table))
                        ->addColumn($column, $type)
                        ->execute();
    }
259900
public function add($name, $type = 'text', array $options = [], $modify = false)
    {
        $this->formHelper->checkFieldName($name, get_class($this));

        if ($this->rebuilding && !$this->has($name)) {
            return $this;
        }

        $this->addField($this->makeField($name, $type, $options), $modify);

        return $this;
    }
1006747
protected function addColumn($propertyType, $name, array $parameters = array()) {


        $attributes = array($name => compact('propertyType'));

        $this->columns[$name] = compact('propertyType');

        return $attributes;

        $attributes = array_merge(compact('propertyType', 'name'), $parameters);

        $this->columns[] = $column = new Fluent($attributes);

        return $column;
    }
402089
public function addColumn($columnName, $type = null, $options = [])
    {
        $column = new Column();
        $column->setName($columnName);
        $column->setType($type);
        $column->setOptions($options);

        $column->setTable($this);

        parent::addColumn($column);

        return $column;
    }
1191919
public RestQueryResult addColumn( String name,
                                      String type ) {
        if (!StringUtil.isBlank(name)) {
            columns.put(name, type);
        }
        return this;
    }
6573
public static function alterColumn(
        $operation,
        $table,
        $column,
        $type = 'text',
        $signed = true,
        $allowNull = true,
        $default = null,
        $position = null,
        $comment = ''
    ) {
        $query = static::getQuery();

        $column = $query->quoteName((array) $column);

        return static::build(
            'ALTER TABLE',
            $query->quoteName($table),
            $operation,
            implode(' ', $column),
            $type ?: 'text',
            $signed ? null : 'UNSIGNED',
            $allowNull ? null : 'NOT NULL',
            $default !== false ? 'DEFAULT ' . static::getQuery()->validValue($default) : null,
            $comment ? 'COMMENT ' . $query->quote($comment) : null,
            static::handleColumnPosition($position)
        );
    }
921935
protected function makeIndexDDL($type, $name = null)
    {
        return implode(
            ' ',
            array_filter(
                [
                    strtoupper($type),
                    $name !== null ? '`' . $name . '`' : null,
                    $this->makeIndexedColumnsDDL(),
                    $this->hasComment() ? "COMMENT '" . addslashes($this->getComment()) . "'" : null
                ]
            )
        );
    }
105890
public function addColumn($name, $type, $length = null)
    {
        $column = new MDatabaseTableColumn($name, $type, $length);
        array_push($this->columns, $column);
    }
1201665
public function addColumn($name, $label = null)
	{
		if (!$this->rowPrimaryKey) {
			$this->rowPrimaryKey = $name;
		}

		$label = $label ? $this->translate($label) : ucfirst($name);
		return $this->columns[$name] = new Column($name, $label, $this);
	}