Options
All
  • Public
  • Public/Protected
  • All
Menu

Table's column options.

Hierarchy

  • TableColumnOptions

Index

Properties

Optional asExpression

asExpression: undefined | string

Generated column expression. Supports only in MySQL.

Optional charset

charset: undefined | string

Defines column character set.

Optional collation

collation: undefined | string

Defines column collation.

Optional comment

comment: undefined | string

Column's comment.

Optional default

default: any

Column's default value.

Optional enum

enum: any[]

Array of possible enumerated values.

Optional generatedType

generatedType: "VIRTUAL" | "STORED"

Generated column type. Supports only in MySQL.

Optional generationStrategy

generationStrategy: "uuid" | "increment"

Specifies generation strategy if this column will use auto increment.

Optional isArray

isArray: undefined | true | false

Indicates if column stores array.

Optional isGenerated

isGenerated: undefined | true | false

Indicates if column is auto-generated sequence.

Optional isNullable

isNullable: undefined | true | false

Indicates if column is NULL, or is NOT NULL in the database.

Optional isPrimary

isPrimary: undefined | true | false

Indicates if column is a primary key.

Optional isUnique

isUnique: undefined | true | false

Indicates if column has unique value.

Optional length

length: undefined | string

Column type's length. Used only on some column types. For example type = "string" and length = "100" means that ORM will create a column with type varchar(100).

name

name: string

Column name.

Optional onUpdate

onUpdate: undefined | string

ON UPDATE trigger. Works only for MySQL.

Optional precision

precision: number | null

The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum number of digits that are stored for the values.

Optional scale

scale: undefined | number

The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number of digits to the right of the decimal point and must not be greater than precision.

type

type: string

Column type.

Optional unsigned

unsigned: undefined | true | false

Puts UNSIGNED attribute on to numeric column. Works only for MySQL.

Optional width

width: undefined | number

Column type's display width. Used only on some column types in MySQL. For example, INT(4) specifies an INT with a display width of four digits.

Optional zerofill

zerofill: undefined | true | false

Puts ZEROFILL attribute on to numeric column. Works only for MySQL. If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column

Generated using TypeDoc