Unexpected behaviour during save with associations #16698
Unanswered
thorque
asked this question in
Help & Questions
Replies: 2 comments
-
With 2 separates post.save() it works properly: await post.save();
post.setAuthor(author);
await post.save(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've tried to store a new entity with an association added:
With this code this sql will be executed:
INSERT INTO "posts" ("authorId","updatedAt","createdAt") VALUES ($1,$2,$3);
This is a little bit unexpected that the values for title and content are ignored. Due to the not null constraint an error occurs.
Does sequelize not support this type of saving?
Best
Thorsten
Beta Was this translation helpful? Give feedback.
All reactions