Table of Contents

Method CreateColumn

Namespace
YndigoBlue.Velocity.Model
Assembly
YndigoBlue.Velocity.dll

CreateColumn(string, DataType, bool, bool, int, byte, byte)

Defines a new column for this table as part of the initial schema definition.

public Column CreateColumn(string name, DataType dataType, bool notNull = false, bool autoGenerate = false, int size = 0, byte precision = 0, byte scale = 0)

Parameters

name string

The name of the column.

dataType DataType

The data type of the column.

notNull bool

Whether the column should have a NOT NULL constraint. Defaults to false.

autoGenerate bool

Whether the column value should be auto-generated (identity/sequence). Defaults to false.

size int

The size of the column for variable-length types such as VarChar. Defaults to 0 (no size limit).

precision byte

The total number of significant digits for numeric types. Defaults to 0.

scale byte

The number of digits to the right of the decimal point for numeric types. Defaults to 0.

Returns

Column

The newly created Column.

Remarks

Use CreateColumn when defining a schema before it is deployed to the database (via BuildSchema(Schema, bool, bool) or CreateTable(Table, bool)). To add a column to an already-deployed table, use AddColumn(string, DataType, bool, bool, int, byte, byte) instead, which marks the column for UpdateSchema(Schema, bool).