Some extensions and fixes
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user