diff --git a/backend/src/clusters/entities/cluster-allocation-log.entity.ts b/backend/src/clusters/entities/cluster-allocation-log.entity.ts index b091d4b..cfc0a50 100644 --- a/backend/src/clusters/entities/cluster-allocation-log.entity.ts +++ b/backend/src/clusters/entities/cluster-allocation-log.entity.ts @@ -17,7 +17,9 @@ export class ClusterAllocationLog { @PrimaryGeneratedColumn('uuid') id: string; - @Column({ nullable: true }) + // Explicit `type` required: `string | null` reflects as Object and crashes + // TypeORM at metadata build (DataTypeNotSupportedError). + @Column({ type: 'uuid', nullable: true }) applicationId?: string | null; @ManyToOne(() => Application, { nullable: true, onDelete: 'SET NULL' }) @@ -27,14 +29,14 @@ export class ClusterAllocationLog { @Column() userId: string; - @Column({ nullable: true }) + @Column({ type: 'uuid', nullable: true }) poolId?: string | null; @ManyToOne(() => ClusterPool, { nullable: true, onDelete: 'SET NULL' }) @JoinColumn({ name: 'poolId' }) pool: ClusterPool; - @Column({ nullable: true }) + @Column({ type: 'uuid', nullable: true }) selectedClusterId?: string | null; @ManyToOne(() => Cluster, { nullable: true, onDelete: 'SET NULL' }) diff --git a/backend/src/users/entities/user.entity.ts b/backend/src/users/entities/user.entity.ts index 87164d0..53cd306 100644 --- a/backend/src/users/entities/user.entity.ts +++ b/backend/src/users/entities/user.entity.ts @@ -18,10 +18,13 @@ export class User { // optional contact field only — it is never used to authenticate. // Both are unique; Postgres treats NULLs as distinct, so accounts missing // either coexist freely. - @Column({ unique: true, nullable: true }) + // NOTE: nullable string columns MUST declare an explicit `type` — TypeScript + // reflects the `string | null` union as `Object`, which TypeORM rejects with + // DataTypeNotSupportedError and crashes the backend at metadata build. + @Column({ type: 'varchar', unique: true, nullable: true }) phone: string | null; // canonical E.164, e.g. +989121234567 - @Column({ unique: true, nullable: true }) + @Column({ type: 'varchar', unique: true, nullable: true }) email: string | null; @Column({ default: false })