commit
486c1de1ba
|
@ -1816,9 +1816,14 @@ DataSource.prototype.defineForeignKey = function defineForeignKey(className, key
|
|||
|
||||
var fkDef = {type: pkType};
|
||||
var foreignMeta = this.columnMetadata(foreignClassName, pkName);
|
||||
if(foreignMeta && foreignMeta.dataType) {
|
||||
if (foreignMeta && (foreignMeta.dataType || foreignMeta.dataLength)) {
|
||||
fkDef[this.connector.name] = {};
|
||||
fkDef[this.connector.name].dataType = foreignMeta.dataType;
|
||||
if (foreignMeta.dataType) {
|
||||
fkDef[this.connector.name].dataType = foreignMeta.dataType;
|
||||
}
|
||||
if (foreignMeta.dataLength) {
|
||||
fkDef[this.connector.name].dataLength = foreignMeta.dataLength;
|
||||
}
|
||||
}
|
||||
if (this.connector.defineForeignKey) {
|
||||
var cb = function (err, keyType) {
|
||||
|
|
Loading…
Reference in New Issue