1
0
forked from noxious/server

Fixed enum fields, new migration file

This commit is contained in:
2024-12-25 02:06:02 +01:00
parent 125d3a3f66
commit c35e27799e
5 changed files with 44 additions and 54 deletions

View File

@ -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 })