-
Notifications
You must be signed in to change notification settings - Fork 988
feat(coderd): add ability to mark workspaces as favorite #11673
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
Changes from 1 commit
46ca00d
015aabb
0b0dce6
9878da7
4fba238
83b03d9
0961298
a814b65
89d618d
7238b95
4eef59a
0f8904d
d921aa0
b68c18e
3d0545a
46103a4
f6c0361
89f0f50
c9ed43c
ff3cde2
f735b69
f6e9531
34f2902
99c7f96
d530546
6392db9
9979c53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
DROP TABLE favorite_workspaces; | ||
ALTER TABLE ONLY workspaces DROP COLUMN favorite_of; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
CREATE TABLE favorite_workspaces ( | ||
user_id uuid NOT NULL, | ||
workspace_id uuid NOT NULL, | ||
UNIQUE(user_id, workspace_id) | ||
); | ||
|
||
ALTER TYPE resource_type ADD VALUE IF NOT EXISTS 'favorite_workspace'; | ||
ALTER TABLE ONLY workspaces | ||
ADD COLUMN favorite_of uuid DEFAULT NULL; | ||
COMMENT ON COLUMN workspaces.favorite_of IS 'FavoriteOf contains the UUID of the workspace owner if the workspace has been favorited.'; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
self-review: just storing a boolean value here doesn't provide enough context to the query to be able to know how to sort favorites.
Uh oh!
There was an error while loading. Please reload this page.
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.
Do you think there is any benefit to using a zero uuid here instead of null? It just makes you not need to use
uuid.NullUUID{...}
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.
Doesn't a workspace have the owner uuid already in the table? If so can't we just use a boolean + that? When I hear "favorite of" I kind of expect the data type to be an array and favorable by many.
If we don't have owner uuid in there, should we just add it vs. the current workaround?
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 was originally wary of making that conditional on owner_id, but now it's looking like it makes more sense in its current shape.