forked from amand33p/bug-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNote.ts
More file actions
39 lines (33 loc) · 677 Bytes
/
Copy pathNote.ts
File metadata and controls
39 lines (33 loc) · 677 Bytes
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
import {
BaseEntity,
Entity,
PrimaryGeneratedColumn,
CreateDateColumn,
UpdateDateColumn,
Column,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { Bug } from './Bug';
import { User } from './User';
@Entity({ name: 'notes' })
export class Note extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@Column()
body: string;
@ManyToOne(() => User, (user) => user)
@JoinColumn({ name: 'authorId' })
author: User;
@Column()
authorId: string;
@ManyToOne(() => Bug, (bug) => bug)
@JoinColumn({ name: 'bugId' })
bug: Bug;
@Column()
bugId: string;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}