diff --git a/core/models.js b/core/models.js index 0bd8f83..cd45088 100644 --- a/core/models.js +++ b/core/models.js @@ -24,6 +24,10 @@ const sequelize = new Sequelize( dialect: 'mysql', operatorAliases: false, logging: config.debug, + define: { + charset: 'utf8', + collate: 'utf8_general_ci', + }, pool: { max: 140, min: 0, diff --git a/modules/notification/notification.model.js b/modules/notification/notification.model.js index eb8e66c..469ec2f 100644 --- a/modules/notification/notification.model.js +++ b/modules/notification/notification.model.js @@ -37,7 +37,7 @@ module.exports = function (sequelize, DataTypes) { }); Notification.associate = function (models) { - //Notification.User = Notification.belongsTo(models.User, { foreignKey: 'userId', as: "user" }); + Notification.User = Notification.belongsTo(models.User, { foreignKey: 'userId', as: "user" }); Notification.Details = Notification.hasMany(models.NotificationDetail, { foreignKey: 'notificationId', as: 'details' }); };