-
Notifications
You must be signed in to change notification settings - Fork 356
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
fix: ignore last_auth_at
to update modified_at
on users table
#8091
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
DROP TRIGGER IF EXISTS autoupdate_users_modified_at ON users; | ||
|
||
CREATE TRIGGER autoupdate_users_modified_at | ||
BEFORE INSERT OR UPDATE OF password_hash, admin, active, display_name, remote ON public.users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to list columns. Are there better way to trigger function? I couldn't find except
or ignore
specific column option in postgres trigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it'd be great if we could do it the other way around. As is if we add a column it would be easy to miss to add it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re the down side of the migration: the added migration is reversible but reversing it means putting the bug back in. do we want to add it? cc @stoksc
DROP TRIGGER IF EXISTS autoupdate_users_modified_at ON users; | ||
|
||
CREATE TRIGGER autoupdate_users_modified_at | ||
BEFORE INSERT OR UPDATE OF password_hash, admin, active, display_name, remote ON public.users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it'd be great if we could do it the other way around. As is if we add a column it would be easy to miss to add it here.
my stance on this has always been no. but i could see an argument you would want to, just incase the bug fix is worse than the bug, and you need to revert it. |
either way is fine, tbh, given the frequency at which folks use down migrations. |
OK. I'll go with the current state then |
) (cherry picked from commit 5483d12)
Description
fix for https://github.com/determined-ai/release-party-issues/issues/786#issuecomment-1749503941
When
last_auth_at
is updated, trigger should ignore the changeTest Plan
modified_at
column is updated only when one or more ofpassword_hash
,admin
,active
,display_name
,remote
column(s) are changed.Commentary (optional)
Checklist
docs/release-notes/
.See Release Note for details.
Ticket