LocChat/server/entities/chat_room.entity.ts

31 lines
639 B
TypeScript
Raw Normal View History

2022-04-01 18:04:00 -04:00
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from 'typeorm';
import { ChatRoomConnection } from './chat_room_connection.entity';
import { User } from './user.entity';
2022-03-29 22:17:08 -04:00
@Entity()
export class ChatRoom {
@PrimaryGeneratedColumn()
2022-04-01 16:16:35 -04:00
id: string;
2022-03-29 22:17:08 -04:00
@Column()
latitude: number;
@Column()
longitude: number;
@Column()
radius: number;
2022-03-31 00:15:20 -04:00
@Column()
name: string;
2022-04-01 18:04:00 -04:00
@Column()
2022-04-01 18:31:24 -04:00
lastModified: Date;
2022-04-01 18:04:00 -04:00
@ManyToOne(() => User, (user) => user.chatRooms)
user: User;
2022-04-01 18:04:00 -04:00
@OneToMany(() => ChatRoomConnection, (chatRoomConnection) => chatRoomConnection.chatRoom)
chatRoomConnections: ChatRoomConnection[];
2022-03-29 22:17:08 -04:00
}