Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@UpdateDateColumn() rendered pretty pointless with recent change #9219

Open
acuthbert opened this issue Jul 19, 2022 · 0 comments
Open

@UpdateDateColumn() rendered pretty pointless with recent change #9219

acuthbert opened this issue Jul 19, 2022 · 0 comments

Comments

@acuthbert
Copy link
Contributor

acuthbert commented Jul 19, 2022

Issue Description

Expected Behavior

const entity = await repos.findOne({..someFindOptions});
entity.this = "that";
await repos.save(entity);

I would expect that the updatedDate column in this entity (using the @UpdateDateColumn decorator) would cause the entitys updated date to be modified.

Actual Behavior

The date is not updated because a change now allows the updated date to be manually provided. This is useful in some cases (e.g. data migration scripts) but more often we just want to load, modify and save. This basic use case is broken by the changes discussed here:

#3271

and highlighted here:

#3271 (comment)

Steps to Reproduce

const entity = await repos.findById(3);
entity.this = "that";
await repos.save(entity);

My Environment

Dependency Version
Operating System Ubuntu 22
Node.js version 16.15.1
Typescript version 4.7.4
TypeORM version 0.2.45

Relevant Database Driver(s)

DB Type Reproducible
aurora-mysql no
aurora-postgres no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql yes
nativescript no
oracle no
postgres no
react-native no
sap no
spanner no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️ Yes, I have the time, and I know how to start.
  • ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant