📜  更改字段名称关系 typeorm - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:34.250000             🧑  作者: Mango

代码示例1
@Table()
export class Post {
    @PrimaryGeneratedColumn()
    id: number;

    @OneToOne(type => Members, member=>member.post)
    @JoinColumn({ name: "member_id" })
    member: Members;

   // this is optional:
   // @Column({  type: "int", nullable: true })
   // memberId: number;

    @Column()
    comment:string;
}