final class ColumnBlueprint (View source)

Collects modifiers for one column while its owning table blueprint is being defined.

Methods

__construct(string $name, ColumnType|string $type, int|string|null $length = null, TableBlueprint|null $table = null)

Initializes this ColumnBlueprint with the collaborators and state required by its database contract.

raw(string $definition)

Provides this part of the database contract while preserving the object's current state and driver semantics.

unsigned(bool $unsigned = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

nullable(bool $nullable = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

default(mixed $value)

Provides this part of the database contract while preserving the object's current state and driver semantics.

defaultExpression(string $expression)

Provides this part of the database contract while preserving the object's current state and driver semantics.

autoIncrement(bool $autoIncrement = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

comment(string $comment)

Provides this part of the database contract while preserving the object's current state and driver semantics.

after(string $column)

Provides this part of the database contract while preserving the object's current state and driver semantics.

first()

Retrieves the requested value without changing the current database state.

renameTo(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

primary(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

index(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

unique(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

fulltext(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Provides this part of the database contract while preserving the object's current state and driver semantics.

Details

__construct

__construct(string $name, ColumnType|string $type, int|string|null $length = null, TableBlueprint|null $table = null)

Initializes this ColumnBlueprint with the collaborators and state required by its database contract.

Parameters

string $name
ColumnType|string $type
int|string|null $length
TableBlueprint|null $table

raw

static ColumnBlueprint raw(string $definition)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $definition

Return Value

ColumnBlueprint

unsigned

ColumnBlueprint unsigned(bool $unsigned = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $unsigned

Return Value

ColumnBlueprint

nullable

ColumnBlueprint nullable(bool $nullable = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $nullable

Return Value

ColumnBlueprint

default

ColumnBlueprint default(mixed $value)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

mixed $value

Return Value

ColumnBlueprint

defaultExpression

ColumnBlueprint defaultExpression(string $expression)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $expression

Return Value

ColumnBlueprint

autoIncrement

ColumnBlueprint autoIncrement(bool $autoIncrement = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $autoIncrement

Return Value

ColumnBlueprint

comment

ColumnBlueprint comment(string $comment)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $comment

Return Value

ColumnBlueprint

after

ColumnBlueprint after(string $column)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $column

Return Value

ColumnBlueprint

first

Retrieves the requested value without changing the current database state.

Return Value

ColumnBlueprint

renameTo

ColumnBlueprint renameTo(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name

Return Value

ColumnBlueprint

primary

ColumnBlueprint primary(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $name

Return Value

ColumnBlueprint

index

ColumnBlueprint index(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $name

Return Value

ColumnBlueprint

unique

ColumnBlueprint unique(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $name

Return Value

ColumnBlueprint

fulltext

ColumnBlueprint fulltext(string|null $name = null)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $name

Return Value

ColumnBlueprint

definition

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

ColumnDefinition