import { ForeignKeyMetadata } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/metadata/ForeignKeyMetadata.ts";
Contains all information about entity's foreign key.
Constructors
new
ForeignKeyMetadata(options: { entityMetadata: EntityMetadata; referencedEntityMetadata: EntityMetadata; namingStrategy?: NamingStrategyInterface; columns: ColumnMetadata[]; referencedColumns: ColumnMetadata[]; onDelete?: OnDeleteType; onUpdate?: OnUpdateType; deferrable?: DeferrableType; })Properties
columns: ColumnMetadata[]
Array of columns of this foreign key.
optional
deferrable: DeferrableTypeWhen to check the constraints of a foreign key.
entityMetadata: EntityMetadata
Entity metadata where this foreign key is.
optional
onDelete: OnDeleteTypeWhat to do with a relation on deletion of the row containing a foreign key.
optional
onUpdate: OnUpdateTypeWhat to do with a relation on update of the row containing a foreign key.
referencedColumns: ColumnMetadata[]
Array of referenced columns.
referencedEntityMetadata: EntityMetadata
Entity metadata which this foreign key references.
Methods
build(namingStrategy: NamingStrategyInterface)
Builds some depend foreign key properties. Must be called after all entity metadatas and their columns are built.