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
namestringThe name of the column.
dataTypeDataTypeThe data type of the column.
notNullboolWhether the column should have a NOT NULL constraint. Defaults to
false.autoGenerateboolWhether the column value should be auto-generated (identity/sequence). Defaults to
false.sizeintThe size of the column for variable-length types such as
VarChar. Defaults to0(no size limit).precisionbyteThe total number of significant digits for numeric types. Defaults to
0.scalebyteThe number of digits to the right of the decimal point for numeric types. Defaults to
0.
Returns
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).