Added ORM entities
This commit is contained in:
21
src/entities/chat.ts
Normal file
21
src/entities/chat.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { Entity, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
||||
import { Character } from './character';
|
||||
import { Zone } from './zone';
|
||||
|
||||
@Entity()
|
||||
export class Chat {
|
||||
@PrimaryKey()
|
||||
id!: number;
|
||||
|
||||
@ManyToOne(() => Character)
|
||||
character!: Character;
|
||||
|
||||
@ManyToOne(() => Zone)
|
||||
zone!: Zone;
|
||||
|
||||
@Property()
|
||||
message!: string;
|
||||
|
||||
@Property()
|
||||
createdAt = new Date();
|
||||
}
|
Reference in New Issue
Block a user