Skip to content

Commit

Permalink
try AbstractEntity changes again
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Sep 25, 2023
1 parent 6835ff9 commit 433aa05
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/cli/src/databases/entities/AbstractEntity.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -49,16 +43,8 @@ function mixinTimestamps<T extends Constructor<{}>>(base: T) {
@CreateDateColumn(tsColumnOptions)
createdAt: Date;

@UpdateDateColumn({
...tsColumnOptions,
onUpdate: timestampSyntax,
})
@UpdateDateColumn(tsColumnOptions)
updatedAt: Date;

@BeforeUpdate()
setUpdateDate(): void {
this.updatedAt = new Date();
}
}
return Derived;
}
Expand Down

0 comments on commit 433aa05

Please sign in to comment.