Skip to content

Migrator

addForeignKey()

addForeignKey() — returns void

Available in: migration Category: Migration Functions

Add a foreign key constraint to the database, using the reference name that was used to create it Only available in a migration CFC

NameTypeRequiredDefaultDescription
tablestringyes—The table name to perform the operation on
referenceTablestringyes—The reference table name to perform the operation on
columnstringyes—The column name to perform the operation on
referenceColumnstringyes—The reference column name to perform the operation on