diff --git a/src/entity/users_roles.ts b/src/entity/users_roles.ts index 10058c8..3f6aafc 100644 --- a/src/entity/users_roles.ts +++ b/src/entity/users_roles.ts @@ -1,46 +1,55 @@ -import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, JoinColumn, ManyToOne, ManyToMany } from 'typeorm'; +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, JoinColumn, ManyToOne, ManyToMany } from "typeorm"; -import { Status } from '../types/status'; -import { Application } from './application'; -import { User } from './users'; +import { Status } from "../types/status"; +import { Application } from "./application"; +import { User } from "./users"; -@Entity('user_roles') +@Entity("user_roles") export class UserRole { - @PrimaryGeneratedColumn('uuid') - id: string; + @PrimaryGeneratedColumn("uuid") + id: string; - @ManyToOne(() => Application, { onDelete: "RESTRICT" }) - @JoinColumn({ name: 'application' }) - application: Application + @ManyToOne(() => Application, { onDelete: "RESTRICT" }) + @JoinColumn({ name: "application" }) + application: Application; - @Column({ - nullable: false, - unique: false, - length: 128 - }) - name: string; + @Column({ + nullable: false, + unique: false, + length: 128, + }) + name: string; - @Column({ - nullable: false, - type: 'jsonb' - }) - roles: string[]; + @Column({ + nullable: false, + type: "jsonb", + }) + roles: string[]; - @Column({ - nullable: false, - length: 64 - }) - status: Status; + @Column({ + nullable: false, + length: 64, + }) + status: Status; - @Column() - @CreateDateColumn() - created_at: Date; + @Column() + @CreateDateColumn() + created_at: Date; - @Column({ nullable: true }) - @UpdateDateColumn() - updated_at: Date; + @Column({ nullable: true, length: 256 }) + created_by: string; - @Column({ nullable: true }) - @DeleteDateColumn() - deleted_at: Date; -} \ No newline at end of file + @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; +}