Notification.js 396 B

12345678910111213141516
  1. module.exports = (sequelize, DataTypes) => {
  2. let Notification = sequelize.define('Notification', {
  3. title: DataTypes.TEXT,
  4. read: DataTypes.BOOLEAN,
  5. type: DataTypes.ENUM('mention', 'thread update')
  6. }, {
  7. classMethods: {
  8. associate (models) {
  9. Notification.hasOne(models.MentionNotification, { as: 'Data' })
  10. Notification.belongsTo(models.User)
  11. }
  12. }
  13. })
  14. return Notification
  15. }