Update primary key constraints in promotional gift models: Set giftId and traitId as primary keys in PromotionalGiftCharacterTrait and PromotionalGiftMood models to ensure data integrity. Enhance FalukantService to load character traits and user house data with separate queries, improving performance and preventing EagerLoadingError.
This commit is contained in:
@@ -10,12 +10,14 @@ PromotionalGiftCharacterTrait.init(
|
||||
giftId: {
|
||||
type: DataTypes.INTEGER,
|
||||
field: 'gift_id',
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
},
|
||||
traitId: {
|
||||
type: DataTypes.INTEGER,
|
||||
field: 'trait_id',
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
},
|
||||
suitability: {
|
||||
type: DataTypes.INTEGER,
|
||||
|
||||
@@ -10,12 +10,14 @@ PromotionalGiftMood.init(
|
||||
giftId: {
|
||||
type: DataTypes.INTEGER,
|
||||
field: 'gift_id',
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
},
|
||||
moodId: {
|
||||
type: DataTypes.INTEGER,
|
||||
field: 'mood_id',
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
primaryKey: true
|
||||
},
|
||||
suitability: {
|
||||
type: DataTypes.INTEGER,
|
||||
|
||||
Reference in New Issue
Block a user