Fixed enum fields, new migration file
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core'
|
||||
import { Character } from './character';
|
||||
import { CharacterItem } from './characterItem';
|
||||
import { CharacterEquipmentSlotType } from '#utilities/enums';
|
||||
@ -8,7 +8,7 @@ export class CharacterEquipment {
|
||||
@PrimaryKey()
|
||||
id!: number;
|
||||
|
||||
@Property()
|
||||
@Enum(() => CharacterEquipmentSlotType)
|
||||
slot!: CharacterEquipmentSlotType;
|
||||
|
||||
@ManyToOne(() => Character)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
|
||||
import { Character } from './character';
|
||||
import { Sprite } from './sprite';
|
||||
import { CharacterGender, CharacterRace } from '#utilities/enums';
|
||||
@ -11,10 +11,10 @@ export class CharacterType {
|
||||
@Property()
|
||||
name!: string;
|
||||
|
||||
@Property()
|
||||
@Enum(() => CharacterGender)
|
||||
gender!: CharacterGender;
|
||||
|
||||
@Property()
|
||||
@Enum(() => CharacterRace)
|
||||
race!: CharacterRace;
|
||||
|
||||
@Property()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Collection, Entity, Enum, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
|
||||
import { Sprite } from './sprite';
|
||||
import { CharacterItem } from './characterItem';
|
||||
import { ItemType, ItemRarity } from '#utilities/enums';
|
||||
@ -14,13 +14,13 @@ export class Item {
|
||||
@Property({ nullable: true })
|
||||
description?: string;
|
||||
|
||||
@Property()
|
||||
@Enum(() => ItemType)
|
||||
itemType!: ItemType;
|
||||
|
||||
@Property()
|
||||
stackable = false;
|
||||
|
||||
@Property()
|
||||
@Enum(() => ItemRarity)
|
||||
rarity: ItemRarity = ItemRarity.COMMON;
|
||||
|
||||
@ManyToOne(() => Sprite, { nullable: true })
|
||||
|
Reference in New Issue
Block a user