dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

Assign foreign key value when creating a row #791

Open markusstephanides opened 7 years ago

markusstephanides commented 7 years ago

Hi.

I have a Session table and a User table. The Session table has a foreign referencing the primary key (id) of the User. Now I want to create a new Session for a user:

db.Session.create({ token: hash, user: user.id, created: new Date()}, cb);

But the user column doesn't get set in the resulting SQL statement. Why?