/
thread.entity.ts
43 lines (32 loc) 路 1.01 KB
/
thread.entity.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { PrimaryGeneratedColumn, BaseEntity, Column, Entity, ManyToOne, JoinColumn } from 'typeorm';
import { User } from './user.entity';
import { App } from './app.entity';
import { Organization } from './organization.entity';
@Entity({ name: 'threads' })
export class Thread extends BaseEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ name: 'x' })
x: number;
@Column({ name: 'y' })
y: number;
@Column({ name: 'app_id' })
appId: string;
@Column({ name: 'app_versions_id' })
appVersionsId: string;
@Column({ name: 'user_id' })
userId: string;
@Column({ name: 'organization_id' })
organizationId: string;
@Column({ default: false, name: 'is_resolved' })
isResolved: boolean;
@ManyToOne(() => User, (user) => user.id)
@JoinColumn({ name: 'user_id' })
user: User;
@ManyToOne(() => App, (app) => app.id)
@JoinColumn({ name: 'app_id' })
app: App;
@ManyToOne(() => Organization, (app) => app.id)
@JoinColumn({ name: 'organization_id' })
organization: Organization;
}