[英]Adding a `updatedDate` column in TypeORM without using the Typescript decorator `@UpdateDateColumn`
我正在为一个项目使用 Javascript 并且无法解决如何在不使用 Typescript @UpdateDateColumn
装饰器的情况下包含updatedDate
列。
在 Typescript:
@UpdateDateColumn()
updatedDate: Date // works perfectly but unfortunately I am not using TS in this project
在 Javascript 中:
createdDate: {
type: 'timestamp', // works fine
},
updatedDate: {
type: 'timestamp', // throws error + everything else I have tried has also thrown an error.
},
updatedDate: {
type: 'time', // works!!!
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.