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
tablestringyesThe table name to perform the operation on
referenceTablestringyesThe reference table name to perform the operation on
columnstringyesThe column name to perform the operation on
referenceColumnstringyesThe reference column name to perform the operation on