Return to v2.1 docs

addForeignKey()


Migrator Migration Functions void migration


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

Name Type Required Default Description
table string Yes The table name to perform the operation on
referenceTable string Yes The reference table name to perform the operation on
column string Yes The column name to perform the operation on
referenceColumn string Yes The reference column name to perform the operation on

Related Functions

Migration Functions