fix(file-service): specify explicit column types for TypeORM entities

Fix DataTypeNotSupportedError by explicitly specifying PostgreSQL column types
for nullable fields that TypeORM was incorrectly inferring as Object type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-10 06:05:36 -08:00
parent d4925719fc
commit 2570e4add9
1 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ export class FileEntity {
@Index()
userId: string;
@Column({ name: 'conversation_id', nullable: true })
@Column({ name: 'conversation_id', type: 'uuid', nullable: true })
@Index()
conversationId: string | null;
@ -56,7 +56,7 @@ export class FileEntity {
@Column({ type: 'enum', enum: FileStatus, default: FileStatus.UPLOADING })
status: FileStatus;
@Column({ name: 'thumbnail_path', nullable: true })
@Column({ name: 'thumbnail_path', type: 'varchar', nullable: true })
thumbnailPath: string | null;
@Column({ type: 'jsonb', nullable: true })
@ -65,7 +65,7 @@ export class FileEntity {
@Column({ name: 'extracted_text', type: 'text', nullable: true })
extractedText: string | null;
@Column({ name: 'error_message', nullable: true })
@Column({ name: 'error_message', type: 'varchar', nullable: true })
errorMessage: string | null;
@CreateDateColumn({ name: 'created_at' })
@ -74,6 +74,6 @@ export class FileEntity {
@UpdateDateColumn({ name: 'updated_at' })
updatedAt: Date;
@Column({ name: 'deleted_at', nullable: true })
@Column({ name: 'deleted_at', type: 'timestamp', nullable: true })
deletedAt: Date | null;
}