Skip to content

Commit 1150dbe

Browse files
committed
fix: upgrade sequelize to latest version to fix CVE
Signed-off-by: BoHong Li <a60814billy@gmail.com>
1 parent 7fcfbae commit 1150dbe

7 files changed

Lines changed: 880 additions & 1675 deletions

File tree

lib/models/author.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ module.exports = function (sequelize, DataTypes) {
1818
unique: true,
1919
fields: ['noteId', 'userId']
2020
}
21-
],
22-
classMethods: {
23-
associate: function (models) {
24-
Author.belongsTo(models.Note, {
25-
foreignKey: 'noteId',
26-
as: 'note',
27-
constraints: false,
28-
onDelete: 'CASCADE',
29-
hooks: true
30-
})
31-
Author.belongsTo(models.User, {
32-
foreignKey: 'userId',
33-
as: 'user',
34-
constraints: false,
35-
onDelete: 'CASCADE',
36-
hooks: true
37-
})
38-
}
39-
}
21+
]
4022
})
23+
24+
Author.associate = function (models) {
25+
Author.belongsTo(models.Note, {
26+
foreignKey: 'noteId',
27+
as: 'note',
28+
constraints: false,
29+
onDelete: 'CASCADE',
30+
hooks: true
31+
})
32+
Author.belongsTo(models.User, {
33+
foreignKey: 'userId',
34+
as: 'user',
35+
constraints: false,
36+
onDelete: 'CASCADE',
37+
hooks: true
38+
})
39+
}
40+
4141
return Author
4242
}

lib/models/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ var config = require('../config')
1010
var logger = require('../logger')
1111

1212
var dbconfig = cloneDeep(config.db)
13-
dbconfig.logging = config.debug ? logger.info : false
13+
dbconfig.logging = config.debug ? (data) => {
14+
logger.info(data)
15+
} : false
1416

1517
var sequelize = null
1618

0 commit comments

Comments
 (0)