From 63c96e7359fff1cbb6198ac0d684cff0cc675667 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Fri, 12 Apr 2019 12:05:32 +0800 Subject: fix: upgrade sequelize to latest version to fix CVE Signed-off-by: BoHong Li --- lib/models/author.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/models/author.js') diff --git a/lib/models/author.js b/lib/models/author.js index 03f832a4..e65791cb 100644 --- a/lib/models/author.js +++ b/lib/models/author.js @@ -18,25 +18,25 @@ module.exports = function (sequelize, DataTypes) { unique: true, fields: ['noteId', 'userId'] } - ], - classMethods: { - associate: function (models) { - Author.belongsTo(models.Note, { - foreignKey: 'noteId', - as: 'note', - constraints: false, - onDelete: 'CASCADE', - hooks: true - }) - Author.belongsTo(models.User, { - foreignKey: 'userId', - as: 'user', - constraints: false, - onDelete: 'CASCADE', - hooks: true - }) - } - } + ] }) + + Author.associate = function (models) { + Author.belongsTo(models.Note, { + foreignKey: 'noteId', + as: 'note', + constraints: false, + onDelete: 'CASCADE', + hooks: true + }) + Author.belongsTo(models.User, { + foreignKey: 'userId', + as: 'user', + constraints: false, + onDelete: 'CASCADE', + hooks: true + }) + } + return Author } -- cgit v1.2.3