UNPKG

synt_backend

Version:

Synt light-weight node backend service

29 lines (28 loc) 776 B
"use strict"; const { Model } = require("sequelize"); module.exports = (sequelize, DataTypes) => { class MeetingItemUser 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.MeetingItem, { foreignKey: "id", as: "MeetingItem" }); } } MeetingItemUser.init( { is_pro: DataTypes.BOOLEAN, }, { sequelize, paranoid: false, modelName: "MeetingItemUser", tableName: "MeetingItemUser", } ); return MeetingItemUser; };