简体   繁体   中英

TypeORM+Postgres: values in nullable columns deleted after server restart?

Any idea why columns defined as nullable in TypeORM have their values deleted after every (nodemon) server restart? Is this expected behaviour?

在此处输入图像描述

After restart:

在此处输入图像描述

The column definition:

      @Column({ nullable: true }) // TypeORM decorator
      @Field(_type => Number, { nullable: true })  // TypeGraphQL decorator
      rating: Rating;  // for reference: type Rating = 0 | 1 | 2 | 3

I had a similar problem, with nullable columns. Deleted dist / build folder fixed it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM