Builder to specify the schema of a table column.

Hierarchy

Constructors

Properties

The default value of the column, if one should exist.

dirty: boolean = false

True if the schema has been modified since created/loaded.

existsInSchema: boolean = false

True if this resource exists, in some form, in the schema.

name: string

The name of the schema item.

originalFromSchema?: ColumnBuilder

If the resource exists in the schema, the unaltered values it has.

parent: TableBuilder

The table this column belongs to.

shouldBeNullable: boolean = false

True if the column should allow NULL values.

shouldBePrimary: boolean = false

True if this is a primary key constraint.

shouldBeUnique: boolean = false

True if this column should contain distinct values.

shouldDrop: "yes" | "exists" | "no" = 'no'

Whether or not the schema item should be dropped.

  • exists - drop if exists
shouldRenameTo?: string

The name the schema item should have if renaming.

shouldSkipIfExists: boolean = false

If true, apply IF NOT EXISTS syntax.

targetLength?: number

The data length of this column, if set

targetType?: FieldType

The data type of the column.

Methods