// Modify implements the TableModifier interface. It creates a column and
// adds the same column to the create array.
170111
func (c ColumnElem) Modify(t *TableElem) error {
	// No modifing nil table elements
	if t == nil {
		return fmt.Errorf("aspect: columns cannot modify a nil table")
	}

	if err := validateColumnName(c.name); err != nil {
		return err
	}

	// No re-using columns across tables
	if c.table != nil {
		return fmt.Errorf(
			"aspect: column '%s' already belongs to table '%s'",
			c.name,
			t.name,
		)
	}

	// Set the parent table of this column
	c.table = t

	// Update the inner clause with the completed ColumnClause
	c.inner = ColumnClause{table: t, name: c.name}

	// Add the column to the unique set of columns for this table
	if duplicate := t.C.Add(c); duplicate != nil {
		return duplicate
	}

	// Add the name to the table order
	t.order = append(t.order, c.name)

	// Add the column to the create array
	t.creates = append(t.creates, c)

	// If the type is a primary key, set the table primary key
	// However, if another pk is already set, panic
	if c.typ.IsPrimaryKey() {
		if t.pk != nil {
			log.Panicf(
				"aspect: cannot set column '%s' as PRIMARY KEY - there is already a primary key set: '%v' - try using a composite primary key with PrimaryKey()",
				c.name,
				t.pk,
			)
		}
		t.pk = PrimaryKeyArray{c.name}
	} else if c.typ.IsUnique() {
		// If the column type is unique, add it to the table's unique
		// constraints TODO Should primary keys beå added to uniques?
		t.uniques = append(t.uniques, UniqueConstraint{c.name})
	}
	return nil
}
1046227
func (m *ModelStatus) MachineModification(machineID string) (status.StatusInfo, error) {
	return m.getStatus(machineGlobalModificationKey(machineID), "modification")
}
1322111
func (uc UniqueConstraint) Modify(table *TableElem) error {
	// Confirm that all columns in the primary key exists
	for _, name := range uc {
		_, exists := table.C[name]
		if !exists {
			return fmt.Errorf(
				"No column with the name '%s' exists in the table '%s'. Is it declared after the PrimaryKey declaration?",
				name, table.Name(),
			)
		}
		// TODO Set the attributes of the column type?
	}

	// Add the unique clause to the table
	table.uniques = append(table.uniques, uc)

	// Add the constraint to the table
	table.creates = append(table.creates, uc)

	return nil
}
130985
func (r *Ring) mod(p int) int {
	return p % len(r.buff)
}
527346
func (cl *memChangelist) Add(c Change) error {
	cl.changes = append(cl.changes, c)
	return nil
}
412585
func (s *DB) ModifyColumn(column string, typ string) *DB {
	scope := s.NewScope(s.Value)
	scope.modifyColumn(column, typ)
	return scope.db
}
351349
func (l *Conn) Modify(modifyRequest *ModifyRequest) error {
	packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request")
	packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID"))
	packet.AppendChild(modifyRequest.encode())

	l.Debug.PrintPacket(packet)

	msgCtx, err := l.sendMessage(packet)
	if err != nil {
		return err
	}
	defer l.finishMessage(msgCtx)

	l.Debug.Printf("%d: waiting for response", msgCtx.id)
	packetResponse, ok := <-msgCtx.responses
	if !ok {
		return NewError(ErrorNetwork, errors.New("ldap: response channel closed"))
	}
	packet, err = packetResponse.ReadPacket()
	l.Debug.Printf("%d: got response %p", msgCtx.id, packet)
	if err != nil {
		return err
	}

	if l.Debug {
		if err := addLDAPDescriptions(packet); err != nil {
			return err
		}
		ber.PrintPacket(packet)
	}

	if packet.Children[1].Tag == ApplicationModifyResponse {
		resultCode, resultDescription := getLDAPResultCode(packet)
		if resultCode != 0 {
			return NewError(resultCode, errors.New(resultDescription))
		}
	} else {
		log.Printf("Unexpected Response: %d", packet.Children[1].Tag)
	}

	l.Debug.Printf("%d: returning", msgCtx.id)
	return nil
}
921782
func (t *Table) Append(row []string) {
	rowSize := len(t.headers)
	if rowSize > t.colSize {
		t.colSize = rowSize
	}

	n := len(t.lines)
	line := [][]string{}
	for i, v := range row {

		// Detect string  width
		// Detect String height
		// Break strings into words
		out := t.parseDimension(v, i, n)

		// Append broken words
		line = append(line, out)
	}
	t.lines = append(t.lines, line)
}
226508
func (t Term) Mod(args ...interface{}) Term {
	return constructMethodTerm(t, "Mod", p.Term_MOD, args, map[string]interface{}{})
}
1316266
func NewModify(a, b noder.Path) Change {
	return Change{
		From: a,
		To:   b,
	}
}
1013774
func (v Values) Add(key, value string) {
	v[key] = append(v[key], value)
}
765272
func (db *postgres) ModifyColumnSql(tableName string, col *core.Column) string {
	return fmt.Sprintf("alter table %s ALTER COLUMN %s TYPE %s",
		tableName, col.Name, db.SqlType(col))
}
1076701
func (r *cmdRun) ModifyContext(ctx context.Context) context.Context {
	if r.verbose {
		ctx = logging.SetLevel(ctx, logging.Debug)
	}
	return ctx
}
47648
func (modulators ModulatorArray) Modulate(msg *Message) ModulateResult {
	action := ModulateResultContinue
	for _, modulator := range modulators {
		switch modRes := modulator.Modulate(msg); modRes {
		case ModulateResultDiscard, ModulateResultFallback:
			return modRes // ### return, break modulator calls ###
		}
	}
	return action
}
687437
func (b *BaseBuilder) AddColumn(table, col, typ string) *Query {
	sql := fmt.Sprintf("ALTER TABLE %v ADD %v %v", b.db.QuoteTableName(table), b.db.QuoteColumnName(col), typ)
	return b.NewQuery(sql)
}
773151
func (client *Client) ModifyDatabaseDescription(args *ModifyDatabaseDescriptionArgs) error {
	response := common.Response{}
	return client.Invoke("ModifyDBDescription", args, &response)
}
60517
func (filterModulator *FilterModulator) Modulate(msg *Message) ModulateResult {
	result, err := filterModulator.ApplyFilter(msg)
	if err != nil {
		logrus.Warning("FilterModulator with error:", err)
	}

	if result == FilterResultMessageAccept {
		return ModulateResultContinue
	}

	newStreamID := result.GetStreamID()
	if newStreamID == InvalidStreamID {
		return ModulateResultDiscard
	}

	msg.SetStreamID(newStreamID)
	return ModulateResultFallback
}