Skip to main content
Module

x/typeorm/src/metadata/ForeignKeyMetadata.ts>ForeignKeyMetadata

Forked from https://github.com/typeorm/typeorm
Latest
class ForeignKeyMetadata
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

columnNames: string[]

Gets array of column names.

columns: ColumnMetadata[]

Array of columns of this foreign key.

optional
deferrable: DeferrableType

When to check the constraints of a foreign key.

entityMetadata: EntityMetadata

Entity metadata where this foreign key is.

name: string

Gets foreign key name.

optional
onDelete: OnDeleteType

What to do with a relation on deletion of the row containing a foreign key.

optional
onUpdate: OnUpdateType

What to do with a relation on update of the row containing a foreign key.

referencedColumnNames: string[]

Gets array of referenced column names.

referencedColumns: ColumnMetadata[]

Array of referenced columns.

referencedEntityMetadata: EntityMetadata

Entity metadata which this foreign key references.

referencedTablePath: string

Gets the table name to which this foreign key is referenced.

Methods

Builds some depend foreign key properties. Must be called after all entity metadatas and their columns are built.