请帮助我,我正在使用帆版本1,我想创建关联,但我得到错误。
error: A hook (`orm`) failed to load!
error: Could not tear down the ORM hook. Error details: Error: Invalid data store identity. No data store exist with that identity.
error: Failed to lift app: { userError: The attribute `id` on the `patients` model is an association but also specifies a type property. This is not needed and will be automatically determined.
所以我有一个2模型(病人和预约),我想从预约中得到病人
//病人.js
module.exports = {
tableName: 'patients',
primaryKey: 'id',
attributes: {
id: {
model: 'Bookings',
type: 'number',
unique: true
}
},
};
//预订.js
module.exports = {
tableName: 'booking',
attributes: {
patient: {
collection: 'Patients',
via: 'id'
}
}
};
1条答案
按热度按时间5q4ezhmt1#
拆下
type
财产来源attributes
你的钥匙Patients.js
正如错误所暗示的那样。