-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
Description
Issue Description
@UpdateDateColumn column updates when using save or update method but not on upsert method
Expected Behavior
@UpdateDateColumn should update automatically with the current timestamp even if using upsert method
Actual Behavior
@UpdateDateColumn does not update with the current timestamp if using upsert. It works only with update method
await this.ormRepository.update(customerEntity.customerId, customerEntity);
Steps to Reproduce
- Create a special column as follows:
@UpdateDateColumn()
updatedAt: Date;- Try to update the entity containing the column using upsert.
My Environment
| Dependency | Version |
| "nestjs/typeorm" | "^8.0.0" |
| Operating System |linux |
| Node.js version | 16.13.0 |
| Typescript version | 4.5.5 |
| TypeORM version | 0.2.38 |
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 |
no |
nativescript |
no |
oracle |
no |
postgres |
yes |
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.
mhadidg, velasquezkevin, a-bahdanau, harryjamesuk, karolis-sh and 9 more