final class TableBlueprint (View source)

Collects declarative column, index, foreign-key, and table-option changes for one table.

Methods

__construct(string $name)

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

id(string $name = 'id')

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

uuid(string $name = 'uuid')

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

char(string $name, int $length = 255)

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

string(string $name, int $length = 255)

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

text(string $name)

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

mediumText(string $name)

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

longText(string $name)

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

integer(string $name)

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

unsignedInteger(string $name)

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

tinyInteger(string $name)

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

smallInteger(string $name)

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

mediumInteger(string $name)

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

bigInteger(string $name)

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

unsignedBigInteger(string $name)

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

boolean(string $name)

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

decimal(string $name, int $precision = 10, int $scale = 2)

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

float(string $name)

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

double(string $name)

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

date(string $name)

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

datetime(string $name)

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

timestamp(string $name)

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

time(string $name)

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

json(string $name)

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

binary(string $name, int|null $length = null)

Adds a binary column, optionally with a fixed length for hashes and opaque identifiers.

void

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

void
softDeletes(string $column = 'deleted_at')

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

void
raw(string $definition)

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

void
modify(string $name, ColumnType|string $type, int|string|null $length = null)

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

renameColumn(string $from, string $to)

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

void
dropColumn(string $column)

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

void
void
primary(string|array $columns, string|null $name = null, bool $ifNotExists = false)
void
void
index(string|array $columns, string|null $name = null, bool $ifNotExists = false)
void
void
unique(string|array $columns, string|null $name = null, bool $ifNotExists = false)
void
void
fulltext(string|array $columns, string|null $name = null, bool $ifNotExists = false)
void
void
spatial(string|array $columns, string|null $name = null, bool $ifNotExists = false)
void
void
dropIndex(string $name)

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

void
void
dropPrimary(string|null $name = null)

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

void
foreign(string|array $columns, string|null $name = null)
void
dropForeign(string $name)

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

void
void
options(TableOptions $options)

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

void
void
engine(string $engine)

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

void
void
charset(string $charset)

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

void
void
collation(string $collation)

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

void
void
comment(string $comment)

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

void

Converts the current database value into the representation required by its consumer.

Details

__construct

__construct(string $name)

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

Parameters

string $name

id

ColumnBlueprint id(string $name = 'id')

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

Parameters

string $name

Return Value

ColumnBlueprint

uuid

ColumnBlueprint uuid(string $name = 'uuid')

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

Parameters

string $name

Return Value

ColumnBlueprint

char

ColumnBlueprint char(string $name, int $length = 255)

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

Parameters

string $name
int $length

Return Value

ColumnBlueprint

string

ColumnBlueprint string(string $name, int $length = 255)

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

Parameters

string $name
int $length

Return Value

ColumnBlueprint

text

ColumnBlueprint text(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

mediumText

ColumnBlueprint mediumText(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

longText

ColumnBlueprint longText(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

integer

ColumnBlueprint integer(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

unsignedInteger

ColumnBlueprint unsignedInteger(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

tinyInteger

ColumnBlueprint tinyInteger(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

smallInteger

ColumnBlueprint smallInteger(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

mediumInteger

ColumnBlueprint mediumInteger(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

bigInteger

ColumnBlueprint bigInteger(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

unsignedBigInteger

ColumnBlueprint unsignedBigInteger(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

boolean

ColumnBlueprint boolean(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

decimal

ColumnBlueprint decimal(string $name, int $precision = 10, int $scale = 2)

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

Parameters

string $name
int $precision
int $scale

Return Value

ColumnBlueprint

float

ColumnBlueprint float(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

double

ColumnBlueprint double(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

date

ColumnBlueprint date(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

datetime

ColumnBlueprint datetime(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

timestamp

ColumnBlueprint timestamp(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

time

ColumnBlueprint time(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

json

ColumnBlueprint json(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

binary

ColumnBlueprint binary(string $name, int|null $length = null)

Adds a binary column, optionally with a fixed length for hashes and opaque identifiers.

Parameters

string $name
int|null $length

Return Value

ColumnBlueprint

timestamps

void timestamps()

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

Return Value

void

softDeletes

ColumnBlueprint softDeletes(string $column = 'deleted_at')

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

Parameters

string $column

Return Value

ColumnBlueprint

raw

void 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

void

modify

ColumnBlueprint modify(string $name, ColumnType|string $type, int|string|null $length = null)

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

Parameters

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

Return Value

ColumnBlueprint

renameColumn

ColumnBlueprint renameColumn(string $from, string $to)

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

Parameters

string $from
string $to

Return Value

ColumnBlueprint

dropColumn

void dropColumn(string $column)

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

Parameters

string $column

Return Value

void

primary

void primary(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

void

index

void index(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

void

unique

void unique(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

void

fulltext

void fulltext(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

void

spatial

void spatial(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

void

dropIndex

void dropIndex(string $name)

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

Parameters

string $name

Return Value

void

dropPrimary

void dropPrimary(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

void

foreign

ForeignKeyBlueprint foreign(string|array $columns, string|null $name = null)

No description

Parameters

string|array $columns
string|null $name

Return Value

ForeignKeyBlueprint

dropForeign

void dropForeign(string $name)

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

Parameters

string $name

Return Value

void

options

void options(TableOptions $options)

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

Parameters

TableOptions $options

Return Value

void

engine

void engine(string $engine)

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

Parameters

string $engine

Return Value

void

charset

void charset(string $charset)

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

Parameters

string $charset

Return Value

void

collation

void collation(string $collation)

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

Parameters

string $collation

Return Value

void

comment

void 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

void

toDefinition

TableDefinition toDefinition()

Converts the current database value into the representation required by its consumer.

Return Value

TableDefinition