Adding a `updatedDate` column in TypeORM without using the Typescript decorator `@UpdateDateColumn`

Viewed 301

I am using Javascript for a project and cannot work out how to include a updatedDate column without using the Typescript @UpdateDateColumn decorator.

In Typescript:

  @UpdateDateColumn()
  updatedDate: Date // works perfectly but unfortunately I am not using TS in this project

In Javascript:

    createdDate: {
      type: 'timestamp', // works fine
    },
    updatedDate: {
      type: 'timestamp', // throws error + everything else I have tried has also thrown an error.
    },
1 Answers
    updatedDate: {
      type: 'time', // works!!!
    },
Related