Add a new column to the table

@param tableName
table name
@param columnName
column name
@param columnDef
column definition
@since 1.1.8
435004
public void addColumn(String tableName, String columnName, String columnDef) {
		execSQL("ALTER TABLE " + CoreSQLUtils.quoteWrap(tableName)
				+ " ADD COLUMN " + CoreSQLUtils.quoteWrap(columnName) + " "
				+ columnDef + ";");
	}
675480
def add_column(table, cname, type)
      if type.to_s == "text"
        puts "attempting to create text column #{cname} at #{table}..."
        begin
          tt = @dbr.prepare("ALTER TABLE #{table} ADD #{cname} text;")
          ee = tt.execute
          puts "column correctly added!".green
        rescue
          puts "error while adding column #{cname} to #{table}".red
          exit
        end

      elsif type.to_s == "num"
        puts "attempting to create numerical column #{cname} at #{table}..."
        begin
          tt = @dbr.prepare("ALTER TABLE #{table} ADD #{cname} int;")
          ee = tt.execute
          puts "column correctly added!".green
        rescue
          puts "error while adding column #{cname} to #{table}".red
          exit
        end

      else
        puts "attempting to create custom (#{type.to_s}) column #{cname} at #{table}..."
        begin
          tt = @dbr.prepare("ALTER TABLE #{table} ADD #{cname} #{type.to_s};")
          ee = tt.execute
          puts "column correctly added!".green
        rescue
          puts "error while adding column #{cname} to #{table}".red
          exit
        end     
      end
    end
1180986
private Column add(String schema, String table, String column, int stepDepth, String alias) {
        Column c = new Column(schema, table, column, this.filteredAllTables.get(schema + "." + table).get(column), stepDepth);
        this.columns.put(c, alias);
        this.aliases.put(alias, c);
        return c;
    }
1135974
public void addColumn(String storeName, String rowKey, String columnName, byte[] columnValue) {
        m_columnUpdates.add(new ColumnUpdate(storeName, rowKey, columnName, columnValue));
    }
1181635
def add_column(self, tablename: str, fieldspec: FIELDSPEC_TYPE) -> int:
        """"""
        sql = "ALTER TABLE {} ADD COLUMN {}".format(
            tablename, self.fielddefsql_from_fieldspec(fieldspec))
        log.info(sql)
        return self.db_exec_literal(sql)
829526
public function addJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
    {
        $this->joinColumns[] = array(
            'name' => $columnName,
            'referencedColumnName' => $referencedColumnName,
            'nullable' => $nullable,
            'unique' => $unique,
            'onDelete' => $onDelete,
            'columnDefinition' => $columnDef,
        );
        return $this;
    }
876880
protected function generateAddFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
    {
        $this->queries[] = "ALTER TABLE \"$tableName\" ADD " . $this->generateFieldSql( $fieldName, $fieldDefinition );
    }
562752
void addColumn(String columnName)
    {
        data.add(new ArrayList<String>());
        columnNames.add(columnName);
    }
485277
public void insert(final String key, final String columnName, final String value) {
    createMutator(keyspace, serializer).insert(
        key, columnFamilyName, createColumn(columnName, value, serializer, serializer));

  }
160513
private BoundStatement addColumnDelete(String tableName, String key, String colName) {
        PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_COLUMN, tableName);
        BoundStatement boundState = prepState.bind();
        boundState.setString(0, key);
        boundState.setString(1, colName);
        return boundState;
    }
72954
def append_column(table, col_name, default_value=None):
    '''
    
    '''
    table[0].append(col_name.strip())
    for row in table[1:]:
        row.append(default_value)
1141204
public function addColumn(TableColumn $column): void
  {
    // Add the column to our array of columns.
    $this->columns[$this->columnIndex] = $column;

    $column->onAddColumn($this, $this->columnIndex);

    // Increase the index for the next added column.
    $this->columnIndex += $column->getColSpan();
  }
1143446
public int columnIndex(final int _tableIndex, final String _columnName)
    {
        final Optional<Column> colOpt = getColumns().stream()
                        .filter(column -> column.tableIndex == _tableIndex && column.columnName.equals(_columnName))
                        .findFirst();
        final int ret;
        if (colOpt.isPresent()) {
            ret = getColumns().indexOf(colOpt.get());
        } else {
            columns.add(new Column(tablePrefix, _tableIndex, _columnName));
            ret = getColumnIdx();
        }
        return ret;
    }
80677
private void addForeignkeys(CollectionDescriptorDef collDef, TableDef tableDef)
    {
        if (!collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_DATABASE_FOREIGNKEY, true))
        {
            // we shall not generate a database foreignkey
            return;
        }

        // a foreignkey is added to the table schema if for both ends of the collection
        // a table exists
        // then the foreignkey consists of:
        //   remote table  = table of collection owner
        //   local fields  = foreignkey fields in the element type 
        //   remote fields = primarykeys of the collection owner type
        ClassDescriptorDef ownerClassDef    = (ClassDescriptorDef)collDef.getOwner();
        String             elementClassName = collDef.getProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF);
        ClassDescriptorDef elementClassDef  = ((ModelDef)ownerClassDef.getOwner()).getClass(elementClassName);

        // we can only generate foreignkeys if the collection itself is not shared by
        // several classes in the hierarchy
        for (Iterator it = ownerClassDef.getAllBaseTypes(); it.hasNext();)
        {
            if (containsCollectionAndMapsToDifferentTable(collDef, tableDef, (ClassDescriptorDef)it.next()))
            {
                return;
            }
        }
        for (Iterator it = ownerClassDef.getAllExtentClasses(); it.hasNext();)
        {
            if (containsCollectionAndMapsToDifferentTable(collDef, tableDef, (ClassDescriptorDef)it.next()))
            {
                return;
            }
        }

        // We add a foreignkey to all classes in the subtype hierarchy of the element type
        // that map to a table (we're silently assuming that they contain the fk fields) 
        ArrayList candidates = new ArrayList();

        if (elementClassDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true))
        {
            candidates.add(elementClassDef);
        }
        for (Iterator it = elementClassDef.getAllExtentClasses(); it.hasNext();)
        {
            ClassDescriptorDef curSubTypeDef = (ClassDescriptorDef)it.next();

            if (curSubTypeDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true))
            {
                candidates.add(curSubTypeDef);
            }
        }

        String    name            = collDef.getName();
        ArrayList remoteFields    = ownerClassDef.getPrimaryKeys();
        HashMap   processedTables = new HashMap();

        for (Iterator it = candidates.iterator(); it.hasNext();)
        {
            elementClassDef = (ClassDescriptorDef)it.next();
            try
            {
                // for the element class and its subclasses
                String elementTableName = elementClassDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE);

                // ensure that tables are only processed once
                if (!processedTables.containsKey(elementTableName))
                {
                    ArrayList localFields     = elementClassDef.getFields(collDef.getProperty(PropertyHelper.OJB_PROPERTY_FOREIGNKEY));
                    TableDef  elementTableDef = getTable(elementTableName);
    
                    if (elementTableDef == null)
                    {
                        elementTableDef = new TableDef(elementTableName);
                        addTable(elementTableDef);
                    }
                    elementTableDef.addForeignkey(name, tableDef.getName(), getColumns(localFields), getColumns(remoteFields));
                    processedTables.put(elementTableName, null);
                }
            }
            catch (NoSuchFieldException ex)
            {
                // Shouldn't happen, but even if, then we're ignoring it and simply don't add the fk
            }
        }
    }
1059605
@Override
    public void deleteByColumn(String schemaName, String tableName, String columnName, Object columnValue)
    { // TODO Auto-generated method stub

    }
965328
public static function addColumn(TableNode $table, array $columnData): TableNode
    {
        $headers = array_keys($columnData);

        $newParameters = $table->getTable();

        foreach ($headers as $header) {
            $row = array_keys($table->getTable())[0];
            $newParameters[$row++][] = $header;
            if (\is_array($columnData[$header])) {
                foreach ($columnData[$header] as $value) {
                    $newParameters[$row++][] = $value;
                }
            } else {
                $newParameters[$row][] = $columnData[$header];
            }
        }

        return new self($newParameters);
    }
604841
public void addColumn(String column) {

        m_columns.add(new CmsSimpleQueryFragment(column, Collections.<Object> emptyList()));
    }