UNPKG

synt_backend

Version:

Synt light-weight node backend service

31 lines (30 loc) 831 B
"use strict"; const { Model } = require("sequelize"); module.exports = (sequelize, DataTypes) => { class NotificationSettingUser extends Model { /** * Helper method for defining associations. * This method is not a part of Sequelize lifecycle. * The `models/index` file will call this method automatically. */ static associate(models) { // define association here this.hasOne(models.User, { foreignKey: "id", as: "User" }); this.hasOne(models.NotificationSetting, { foreignKey: "id", as: "NotificationSetting", }); } } NotificationSettingUser.init( { value: DataTypes.BOOLEAN, }, { sequelize, modelName: "NotificationSettingUser", tableName: "NotificationSettingUser", } ); return NotificationSettingUser; };