Files
yourpart3/backend/models/falukant/predefine/promotional_gift_mood.js
2025-01-28 09:55:36 +01:00

46 lines
942 B
JavaScript

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;