1
0
forked from noxious/server

#293: Changed IDs to UUIDs for all entities

This commit is contained in:
2025-01-01 20:53:05 +01:00
parent 465219276d
commit 586bb0ca83
17 changed files with 79 additions and 52 deletions

View File

@ -1,3 +1,5 @@
import { randomUUID } from 'node:crypto'
import { Collection, Entity, ManyToOne, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
import { Character } from './character'
@ -5,11 +7,12 @@ import { Sprite } from './sprite'
import { BaseEntity } from '#application/base/baseEntity'
import { CharacterGender } from '#application/enums'
import { UUID } from '#application/types'
@Entity()
export class CharacterHair extends BaseEntity {
@PrimaryKey()
id!: number
id = randomUUID()
@Property()
name!: string
@ -23,7 +26,7 @@ export class CharacterHair extends BaseEntity {
@ManyToOne({ nullable: true })
sprite?: Sprite
setId(id: number) {
setId(id: UUID) {
this.id = id
return this
}