diff --git a/src/entity/earchive_doc.ts b/src/entity/earchive_doc.ts index d984f22..30dfbed 100644 --- a/src/entity/earchive_doc.ts +++ b/src/entity/earchive_doc.ts @@ -7,6 +7,7 @@ import { EarchiveApproval } from "./earchive_approval"; import { EarchiveLink } from "./earchive_link"; import { EarchiveDisposisi } from "./earchive_disposisi"; import { EarchiveChecker } from "./earchive_checker"; +import { EarchiveStar } from "./earchive_star"; @Entity("earchive_doc", { schema: "earchive" }) export class EarchiveDoc { @@ -126,6 +127,9 @@ export class EarchiveDoc { @OneToMany(() => EarchiveDisposisi, (r) => r.doc) disposisi: EarchiveDisposisi[]; + @OneToMany(() => EarchiveStar, (r) => r.doc) + star: EarchiveStar[]; + @Column() @CreateDateColumn() created_at: Date; diff --git a/src/entity/earchive_star.ts b/src/entity/earchive_star.ts new file mode 100644 index 0000000..fc7c80e --- /dev/null +++ b/src/entity/earchive_star.ts @@ -0,0 +1,42 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { User } from "./users"; +import { EarchiveDoc } from "./earchive_doc"; + +@Entity("earchive_star", { schema: "earchive" }) +export class EarchiveStar { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => EarchiveDoc, { nullable: true }) + @JoinColumn({ name: 'doc' }) + doc: EarchiveDoc; + + @ManyToOne(() => User, { nullable: true }) + @JoinColumn({ name: 'id' }) + userid: User; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ name: 'createdbyid', type: 'uuid', nullable: true }) + createdbyid: string; + + @ManyToOne(() => User, { nullable: true }) + @JoinColumn({ name: 'createdbyid' }) + createdby: User + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +}