diff --git a/packages/cli/src/databases/entities/AbstractEntity.ts b/packages/cli/src/databases/entities/AbstractEntity.ts index 475356a8b53e2e..9a34ae85059179 100644 --- a/packages/cli/src/databases/entities/AbstractEntity.ts +++ b/packages/cli/src/databases/entities/AbstractEntity.ts @@ -1,11 +1,5 @@ import type { ColumnOptions } from 'typeorm'; -import { - BeforeInsert, - BeforeUpdate, - CreateDateColumn, - PrimaryColumn, - UpdateDateColumn, -} from 'typeorm'; +import { BeforeInsert, CreateDateColumn, PrimaryColumn, UpdateDateColumn } from 'typeorm'; import config from '@/config'; import { generateNanoId } from '../utils/generators'; @@ -49,16 +43,8 @@ function mixinTimestamps>(base: T) { @CreateDateColumn(tsColumnOptions) createdAt: Date; - @UpdateDateColumn({ - ...tsColumnOptions, - onUpdate: timestampSyntax, - }) + @UpdateDateColumn(tsColumnOptions) updatedAt: Date; - - @BeforeUpdate() - setUpdateDate(): void { - this.updatedAt = new Date(); - } } return Derived; }