import { Model, DataTypes } from 'sequelize'; import { sequelize } from '../../../utils/sequelize.js'; import PromotionalGift from '../type/promotional_gift.js'; import Mood from '../type/mood.js'; class PromotionalGiftMood extends Model {} PromotionalGiftMood.init( { gift_id: { type: DataTypes.INTEGER, references: { model: PromotionalGift, key: 'id', }, allowNull: false, }, mood_id: { type: DataTypes.INTEGER, references: { model: Mood, key: 'id', }, allowNull: false, }, suitability: { type: DataTypes.INTEGER, allowNull: false, validate: { min: 1, max: 5, }, }, }, { sequelize, modelName: 'PromotionalGiftMood', tableName: 'promotional_gift_mood', schema: 'falukant_predefine', timestamps: false, underscored: true, } ); export default PromotionalGiftMood;