Implemented houses
This commit is contained in:
@@ -62,6 +62,9 @@ import PromotionalGiftMood from './falukant/predefine/promotional_gift_mood.js';
|
||||
import RelationshipType from './falukant/type/relationship.js';
|
||||
import Relationship from './falukant/data/relationship.js';
|
||||
import PromotionalGiftLog from './falukant/log/promotional_gift.js';
|
||||
import HouseType from './falukant/type/house.js';
|
||||
import BuyableHouse from './falukant/data/buyable_house.js';
|
||||
import UserHouse from './falukant/data/user_house.js';
|
||||
|
||||
export default function setupAssociations() {
|
||||
// UserParam related associations
|
||||
@@ -352,4 +355,16 @@ export default function setupAssociations() {
|
||||
|
||||
PromotionalGiftCharacterTrait.belongsTo(PromotionalGift, { foreignKey: 'gift_id', as: 'promotionalgiftcharactertrait' });
|
||||
PromotionalGiftMood.belongsTo(PromotionalGift, { foreignKey: 'gift_id', as: 'promotionalgiftcharactermood' });
|
||||
|
||||
HouseType.hasMany(BuyableHouse, { foreignKey: 'houseTypeId', as: 'buyableHouses' });
|
||||
BuyableHouse.belongsTo(HouseType, { foreignKey: 'houseTypeId', as: 'houseType' });
|
||||
|
||||
HouseType.hasMany(UserHouse, { foreignKey: 'houseTypeId', as: 'userHouses' });
|
||||
UserHouse.belongsTo(HouseType, { foreignKey: 'houseTypeId', as: 'houseType' });
|
||||
|
||||
FalukantUser.hasOne(UserHouse, { foreignKey: 'userId', as: 'userHouse' });
|
||||
UserHouse.belongsTo(FalukantUser, { foreignKey: 'userId', as: 'houseUser' });
|
||||
|
||||
TitleOfNobility.hasMany(HouseType, { foreignKey: 'minimumNobleTitle', as: 'houseTypes' });
|
||||
HouseType.belongsTo(TitleOfNobility, { foreignKey: 'minimumNobleTitle', as: 'titleOfNobility' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user