feat(commons): 为实体统一添加软删除相关字段。

This commit is contained in:
Ivan Li 2021-03-07 22:12:15 +08:00
parent bf4590bd4c
commit bba7963949
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import { Field, ID, ObjectType } from '@nestjs/graphql';
import {
CreateDateColumn,
DeleteDateColumn,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
@ -16,4 +17,7 @@ export class AppBaseEntity {
@UpdateDateColumn({ select: false })
updatedAt: Date;
@DeleteDateColumn({ select: false })
deletedAt?: Date;
}

View File

@ -22,7 +22,4 @@ export class Project extends AppBaseEntity {
@Column({ nullable: true })
webHookSecret?: string;
@DeleteDateColumn()
deletedAt?: Date;
}