zappyzep/backend/src/data/entities/Supporter.ts
Dragory 2f50232cf3
Fix TypeORM errors for nullable fields
For fields with '| null' in the TS type, the column type needs to be
specified explicitly in column options when using MySQL.

See:
https://github.com/typeorm/typeorm/issues/1358#issuecomment-391736766
2020-11-09 20:12:16 +02:00

14 lines
256 B
TypeScript

import { Column, Entity, PrimaryColumn } from "typeorm";
@Entity("supporters")
export class Supporter {
@Column()
@PrimaryColumn()
user_id: string;
@Column()
name: string;
@Column({ type: String, nullable: true })
amount: string | null;
}