You can change the column name used for any attribute of the model by setting the property columnName:
attributes: {
breed: 'string',
type: 'string',
name: 'string',
// Add a reference to User
owner: {
columnName: 'owner_id',
model: 'user'
}
}
, Sails Waterline, /api/models , . User.js:
module.exports = {
attributes: {
breed: 'string',
type: 'string',
name: 'string',
owner: {
model: 'user',
columnName: 'owner_id'
}
}
}
Sails/Waterline , .