
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
14 lines
256 B
TypeScript
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;
|
|
}
|