getVersion(), '1.1.0', '<')) { $table = $setup->getTable('customer_entity'); $setup->getConnection()->addForeignKey( $setup->getFkName(CustomerLink::TABLE_NAME, 'customer_id', $table, 'entity_id'), $setup->getTable(CustomerLink::TABLE_NAME), 'customer_id', $setup->getTable('customer_entity'), 'entity_id', AdapterInterface::FK_ACTION_CASCADE ); } if (version_compare($context->getVersion(), '1.2.0', '<')) { $setup->getConnection()->addIndex( $setup->getTable(CustomerLink::TABLE_NAME), $setup->getIdxName(CustomerLink::TABLE_NAME, ['customer_id'], AdapterInterface::INDEX_TYPE_UNIQUE), ['customer_id'], AdapterInterface::INDEX_TYPE_UNIQUE ); } } }