fix(db): explicit TypeORM column types for nullable string/uuid columns
`string | null` / `uuid | null` columns reflect as Object and crash the backend at metadata build (DataTypeNotSupportedError). Declare explicit `type` on users.phone/email and cluster_allocation_logs FK id columns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user