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

updated_at column is not updated on save #104

Open
greenfork opened this issue Jun 28, 2023 · 0 comments
Open

updated_at column is not updated on save #104

greenfork opened this issue Jun 28, 2023 · 0 comments

Comments

@greenfork
Copy link

When creating a standard controller with joy create controller, the "patch" looks like this:

(defn accounts/patch [req]
  (when-let [account (account req)
             account (->> req account/body (merge account) db/save)]

    (if (saved? account)
      (redirect-to :accounts/index)
      (accounts/edit req (errors account)))))

It uses db/save from joy/db.janet which uses db/insert with ON CONFLICT UPDATE clause. But the column updated_at is only updated with db/update.

I personally don't think that the column updated_at even deserves to stay alive so it is not a problem for me, just reporting a thing that doesn't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant