LocChat/server/entities/chat_room_connection.entity.ts

16 lines
413 B
TypeScript
Raw Normal View History

2022-04-01 18:04:00 -04:00
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
import { User } from './user.entity';
import { ChatRoom } from './chat_room.entity';
@Entity()
export class ChatRoomConnection {
@PrimaryGeneratedColumn()
id: string;
@ManyToOne(() => User, (user) => user.chatRooms)
user: User;
@ManyToOne(() => ChatRoom, (chatRoom) => chatRoom.chatRoomConnections)
chatRoom: ChatRoom;
}