Table of Contents

Method CreateColumn

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

CreateColumn(Column)

Adds a new column to an existing table in the database.

public void CreateColumn(Column column)

Parameters

column Column

The Column object defining the column to add.

Examples

using (var m = new Manager(conn))
{
    var schema = m.LoadSchema("app");
    var table = schema["users"];

    // Create a new column
    var newColumn = new Column("phone", DataType.VarChar, 20);
    newColumn.Table = table;

    m.CreateColumn(newColumn);
}

Exceptions

DbException

Thrown when a database error occurs.