actually we don't need to define default on CreateDateColumn and default and onUpdate on UpdateDateColumn, typeorm do this by his self

This commit is contained in:
einhornimmond 2025-10-09 06:32:43 +02:00
parent d7aac639b5
commit 671c7b238d

View File

@ -5,10 +5,10 @@ export class OpenaiThreads extends BaseEntity {
@PrimaryColumn({ type: 'char', length: 30 }) @PrimaryColumn({ type: 'char', length: 30 })
id: string id: string
@CreateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }) @CreateDateColumn({ type: 'timestamp' })
createdAt: Date createdAt: Date
@UpdateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' }) @UpdateDateColumn({ type: 'timestamp' })
updatedAt: Date updatedAt: Date
@Column({ name: 'user_id', type: 'int', unsigned: true }) @Column({ name: 'user_id', type: 'int', unsigned: true })