📜  sequelize 关联辅助方法 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:45.089000             🧑  作者: Mango

代码示例1
image.getComments()
SELECT * FROM comments WHERE commentable_id = 42 AND commentable = 'image';

image.createComment({
  title: 'Awesome!'
})
INSERT INTO comments (title, commentable_id, commentable) VALUES ('Awesome!', 42, 'image');

image.addComment(comment);
UPDATE comments SET commentable_id = 42, commentable = 'image'