vapor / fluent-mysql-driver

🖋🐬 Swift ORM (queries, models, relations, etc) built on MySQL.
MIT License
78 stars 52 forks source link

Timestamps are deleted when using `create(orUpdate:on:)` (upserts) #152

Closed cweinberger closed 4 years ago

cweinberger commented 5 years ago

Assuming you have a model conforming to Timestampable you would expect that its createdAt and updatedAt values are updated properly. This works fine when using Fluent's save() method. It does not, when using create(orUpdate:on:).

Observed behavior

(given that createdAt/updatedAt are not set manually before upserting the model)

Expected behavior

When upserting ...

Affects

Fluent 3 (3.1.0)