class ForeignKey

Methods

__construct(string|null $name, array $columns, TableReference $foreignTable, array $foreignColumns = [], ReferentialAction $onUpdate = ReferentialAction::NoAction, ReferentialAction $onDelete = ReferentialAction::NoAction, ForeignKeyMatch $match = ForeignKeyMatch::Simple, Deferral|null $deferral = null, bool $valid = true, bool $enforced = true)

Create a foreign key definition.

Details

at line 16
__construct(string|null $name, array $columns, TableReference $foreignTable, array $foreignColumns = [], ReferentialAction $onUpdate = ReferentialAction::NoAction, ReferentialAction $onDelete = ReferentialAction::NoAction, ForeignKeyMatch $match = ForeignKeyMatch::Simple, Deferral|null $deferral = null, bool $valid = true, bool $enforced = true)

Create a foreign key definition.

Parameters

string|null $name
array $columns
TableReference $foreignTable
array $foreignColumns
ReferentialAction $onUpdate
ReferentialAction $onDelete
ForeignKeyMatch $match
Deferral|null $deferral
bool $valid

whether the declaration validates existing rows; false for NOT VALID or NOT ENFORCED

bool $enforced