-
Notifications
You must be signed in to change notification settings - Fork 889
feat(coderd): add last_seen_at and version to provisioner_daemons table #11033
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
Conversation
a05e8ae
to
546e211
Compare
546e211
to
1c7c901
Compare
@@ -40,7 +40,9 @@ type ProvisionerDaemon struct { | |||
ID uuid.UUID `json:"id" format:"uuid"` | |||
CreatedAt time.Time `json:"created_at" format:"date-time"` | |||
UpdatedAt sql.NullTime `json:"updated_at" format:"date-time"` |
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.
nit: just spotted, if this is sql.NullTime
, then the property should have omitempty
.
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.
Just a note here that omitempty
isn't actually relevant. Since sql.NullTime
is a struct, it can't be omitted even when the struct is "zero".
https://go.dev/play/p/SGmN64SRt8F
Omitempty can be relevant in e.g. codersdk when we use codersdk.NullTime
that implements MarshalJSON
. In that case it might help with generation of TypeScript types (unless we handle the type specifically in gen).
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 just realized that using format
here is wrong, too (it'd be OK for codersdk.NullTime
).
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.
@mafredri sounds like UpdatedAt
should be a codersdk.NullTime
then in the API struct?
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 @johnstcn, I think that would be better 👍🏻
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.
52dffd9
to
df18a13
Compare
Related to #10676
Updates LastUsedAt to be awill be done in fix(codersdk): make codersdk.ProvisionerDaemon.UpdatedAt a codersdk.NullTime #11037codersdk.NullTime
instead of asql.NullTime