no message
This commit is contained in:
parent
b14d2d4a46
commit
428ed28b64
4 changed files with 222 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { State } from "./State";
|
||||
import { StateOperatorUser } from "./StateOperatorUser";
|
||||
|
||||
@Entity("stateOperator")
|
||||
export class StateOperator extends EntityBase {
|
||||
|
|
@ -71,4 +72,7 @@ export class StateOperator extends EntityBase {
|
|||
@ManyToOne(() => State, (state) => state.stateOperators)
|
||||
@JoinColumn({ name: "stateId" })
|
||||
state: State;
|
||||
|
||||
@OneToMany(() => StateOperatorUser, (stateOperatorUser) => stateOperatorUser.stateOperator)
|
||||
stateOperatorUsers: StateOperatorUser[];
|
||||
}
|
||||
|
|
|
|||
42
src/entities/StateOperatorUser.ts
Normal file
42
src/entities/StateOperatorUser.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { StateOperator } from "./StateOperator";
|
||||
import { Workflow } from "./Workflow";
|
||||
|
||||
@Entity("stateOperatorUser")
|
||||
export class StateOperatorUser extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
profile: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
type: string; //commander
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ลำดับ",
|
||||
default: null,
|
||||
})
|
||||
order: number; //
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง stateOperator",
|
||||
default: null,
|
||||
})
|
||||
stateOperatorId: string;
|
||||
|
||||
@ManyToOne(() => StateOperator, (stateOperator) => stateOperator.stateOperatorUsers)
|
||||
@JoinColumn({ name: "stateOperatorId" })
|
||||
stateOperator: StateOperator;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue