Fix the id column name
This commit is contained in:
parent
5b32141e31
commit
31473d3add
|
@ -399,9 +399,16 @@ DataSource.prototype.discoverSchema = function (owner, table, cb) {
|
|||
|
||||
var foreignKeys = results[2];
|
||||
foreignKeys.forEach(function(fk) {
|
||||
fks[fk.fkColumnName] = fk.keySeq;
|
||||
fks[fk.fkColumnName] = {
|
||||
keySeq: fk.keySeq,
|
||||
owner: fk.pkOwner,
|
||||
tableName: fk.pkTableName,
|
||||
columnName: fk.pkColumnName
|
||||
};
|
||||
});
|
||||
|
||||
console.log(fks);
|
||||
|
||||
if (!columns) {
|
||||
cb && cb();
|
||||
return;
|
||||
|
@ -542,7 +549,7 @@ DataSource.prototype.getIDColumnName = function(modelName) {
|
|||
}
|
||||
});
|
||||
if(props.id) {
|
||||
return 'id';
|
||||
return self.columnName(modelName, 'id');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue