With a fresh table, user.id is starting with value 0. I ran into this issue with MySQL 5 when using the statement:
user.$relatedQuery('locations').then( ... )
knex debugging yields:
...sql: 'select * from GPSLocation where 1 = ?'
Here is my relationshipMappings:
User.relationMappings = {
locations: {
relation: Model.HasManyRelation,
modelClass: GPSLocation,
join: {
from: 'User.id',
to: 'GPSLocation.user_id'
}
}
};