-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Drop global unique name constrain, scope to user #2359
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
LGTM overall, there still seems to be an issue on Vercel deployment but I'll approve for now. Can we now delete a user account or was this already the case in the past? 😃
@@ -29,16 +36,39 @@ export const UserController = controller({ | |||
const session = await getServerSession(req, res, nextAuthOptions); | |||
const userId = session?.user?.id; | |||
|
|||
return await getPalettesForUser(userId); | |||
if (!userId) { |
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: Could use assertion here
Thanks @noahonyejese 🙇♂️ Yeah, in order to merge this PR, we'd actually first need to tackle #2360 to improve the way we handle migrations (and to fix Vercel deployment). We can't remove accounts yet, but just to be prepared for the future 😄 |
Fundamentally, these changes look good to me. However, the client has recently decided that unique palette names (globally) is useful to them. It may therefore make sense to drop the uniqueness constraint changes here but keep the other enhancements, i.e.
For added context, there are ongoing conversations outside this thread regarding the overall streamlining of the DB design, enhancing it to accommodate palette sharing and potentially moving to the proper use of prisma migrations (i.e. moving from |
Closes #2358
This PR makes sure:
User
deletion (cascading delete).Also see: https://www.prisma.io/docs/orm/reference/prisma-schema-reference#unique-1