diff options
author | BoHong Li | 2019-04-12 12:05:32 +0800 |
---|---|---|
committer | Sheogorath | 2019-06-11 00:41:50 +0200 |
commit | 63c96e7359fff1cbb6198ac0d684cff0cc675667 (patch) | |
tree | 43b1afbe81cb356d899cab30716ff085c7890b42 /lib/models/author.js | |
parent | 02929cd4bf6da3596dde33ebfd8369e0914929a5 (diff) |
fix: upgrade sequelize to latest version to fix CVE
Signed-off-by: BoHong Li <a60814billy@gmail.com>
Diffstat (limited to 'lib/models/author.js')
-rw-r--r-- | lib/models/author.js | 38 |
1 files changed, 19 insertions, 19 deletions
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 } |