summaryrefslogtreecommitdiff
path: root/lib/models/author.js
diff options
context:
space:
mode:
authorBoHong Li2019-04-12 12:05:32 +0800
committerSheogorath2019-06-11 00:41:50 +0200
commit63c96e7359fff1cbb6198ac0d684cff0cc675667 (patch)
tree43b1afbe81cb356d899cab30716ff085c7890b42 /lib/models/author.js
parent02929cd4bf6da3596dde33ebfd8369e0914929a5 (diff)
fix: upgrade sequelize to latest version to fix CVE
Signed-off-by: BoHong Li <a60814billy@gmail.com>
Diffstat (limited to '')
-rw-r--r--lib/models/author.js38
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
}