【发布时间】:2016-10-25 04:11:30
【问题描述】:
我点击此链接并尝试显示数据
http://sailsjs.org/documentation/concepts/models-and-orm/associations/one-way-association
但我收到错误“'字段列表'中的未知列'shop.building_detail'”
是风帆问题还是我做错了什么?
下面有我的数据库设计和我的代码
店铺型号:
module.exports = {
autoPK:false,
attributes : {
shop_id : {
primaryKey : true,
type : 'int',
unique: true,
columnName : 'shop_id'
},
shop_floor : {
type : 'string'
},
shop_room : {
type : 'string'
},
shop_build : {
type : 'int',
foreignKey:'true'
},
building_detail : {
model : 'building'
}
}
};
建筑模型:
module.exports = {
autoPK:false,
attributes : {
build_id : {
primaryKey : true,
type : 'int',
unique: true,
columnName : 'build_id'
},
build_name : {
type : 'string'
},
build_address : {
type : 'string'
},
build_latitude : {
type : 'float'
},
build_longitude : {
type : 'float'
},
build_visit_count : {
type : 'int'
},
build_status : {
type : 'string'
},
build_status_last_update_time : {
type : 'time'
}
}
};
【问题讨论】:
标签: sails.js