Some extensions and fixes

This commit is contained in:
Torsten Schulz
2025-01-28 09:55:36 +01:00
parent 2f60741116
commit 90b4f51dcb
27 changed files with 910 additions and 53 deletions

View File

@@ -0,0 +1,45 @@
import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
import PromotionalGift from '../type/promotional_gift.js';
import CharacterTrait from '../type/character_trait.js';
class PromotionalGiftCharacterTrait extends Model {}
PromotionalGiftCharacterTrait.init(
{
gift_id: {
type: DataTypes.INTEGER,
references: {
model: PromotionalGift,
key: 'id',
},
allowNull: false,
},
trait_id: {
type: DataTypes.INTEGER,
references: {
model: CharacterTrait,
key: 'id',
},
allowNull: false,
},
suitability: {
type: DataTypes.INTEGER,
allowNull: false,
validate: {
min: 1,
max: 5,
},
},
},
{
sequelize,
modelName: 'PromotionalGiftCharacterTrait',
tableName: 'promotional_gift_character_trait',
schema: 'falukant_predefine',
timestamps: false,
underscored: true,
}
);
export default PromotionalGiftCharacterTrait;