From 3644b854324051d186948c6d49245089eb4d77f2 Mon Sep 17 00:00:00 2001 From: didikeke Date: Wed, 11 Mar 2015 11:30:40 +0800 Subject: [PATCH] fix foreign key dataType bug --- lib/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datasource.js b/lib/datasource.js index 38271117..28f6378a 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -1710,7 +1710,7 @@ DataSource.prototype.defineForeignKey = function defineForeignKey(className, key } var fkDef = {type: pkType}; - var foreignMeta = this.columnMetadata(foreignClassName, key); + var foreignMeta = this.columnMetadata(foreignClassName, pkName); if(foreignMeta && foreignMeta.dataType) { fkDef[this.connector.name] = {}; fkDef[this.connector.name].dataType = foreignMeta.dataType;