/
ActionLog.ts
42 lines (34 loc) · 1.22 KB
/
ActionLog.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
import {PrimaryGeneratedColumn} from "../../../../src/decorator/columns/PrimaryGeneratedColumn";
import {Entity} from "../../../../src/decorator/entity/Entity";
import {Column} from "../../../../src/decorator/columns/Column";
import {JoinColumn} from "../../../../src/decorator/relations/JoinColumn";
import {JoinTable} from "../../../../src/decorator/relations/JoinTable";
import {ManyToOne} from "../../../../src/decorator/relations/ManyToOne";
import {ManyToMany} from "../../../../src/decorator/relations/ManyToMany";
import {OneToOne} from "../../../../src/decorator/relations/OneToOne";
import {ActionDetails} from "./ActionDetails";
import {Address} from "./Address";
import {Person} from "./Person";
@Entity()
export class ActionLog {
@PrimaryGeneratedColumn()
id: number;
@Column()
date: Date;
@Column()
action: string;
@ManyToOne(type => Person, {
createForeignKeyConstraints: false
})
person: Person;
@ManyToMany(type => Address, {
createForeignKeyConstraints: false
})
@JoinTable()
addresses: Address[];
@OneToOne(type => ActionDetails, {
createForeignKeyConstraints: false
})
@JoinColumn()
actionDetails: ActionDetails;
}