繁体   English   中英

在不使用 Typescript 装饰器 `@UpdateDateColumn` 的情况下在 TypeORM 中添加 `updatedDate` 列

[英]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.

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