Last active
July 26, 2017 21:58
-
-
Save apedicdev/0522d4a3dd8212c9b813ab4a24407b55 to your computer and use it in GitHub Desktop.
magento 2 add foreign key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
->addForeignKey( | |
$installer->getFkName($tableName, COLUMN_NAME, $tableNameFkName, COLUMNFK_NAME), | |
COLUMN_NAME, //column has to be UNSIGNED if the foreign column is | |
$installer->getTable($tableNameFkName), | |
COLUMNFK_NAME, | |
\Magento\Framework\DB\Ddl\Table::ACTION_CASCADE | |
) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
column has to be UNSIGNED if the foreign column is