node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

Assign foreign key value when creating a row

Open markusstephanides opened this issue 8 years ago • 0 comments

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?

markusstephanides avatar Jun 17 '17 14:06 markusstephanides