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

[RFC]: Remove default UserExample model in newly generated Redwood app #10879

Open
1 task done
cannikin opened this issue Jun 26, 2024 · 2 comments
Open
1 task done
Assignees

Comments

@cannikin
Copy link
Member

Summary

When we first integrated with Prisma, they'd throw a nasty error if you tried to run prisma generate with no model defined in your schema.prisma file. Since prisma generate was automatically invoked every time you ran yarn rw dev it would blow up the dev server.

To get around this, we added a default UserExample model to the schema file so that there was always something there to prevent Prisma from freaking out.

But it looks like Prisma has a more reasonable error message now, so I think the time has come to remove that default model and either just show an example in comments, or link to a documentation page explaining how to use the file. We'll need to double check and see if this is actually an error that breaks the yarn rw dev chain of commands that runs...if so, maybe we can ignore the error and keep going with starting up the dev server:

image

Motivation

The UserExample can be confusing because if you run your migrations without removing it, you'll now have an extra database table that you never explicitly created.

Detailed proposal

  • Update the schema.prisma template in the create-redwood-app package
  • Update the tutorial where it talks about the contents of this file on first open
  • Update/create any docs explaining schema.prisma

Are you interested in working on this?

  • I'm interested in working on this
@cannikin cannikin self-assigned this Jun 26, 2024
@dthyresson
Copy link
Contributor

The UserExample can be confusing because if you run your migrations without removing it, you'll now have an extra database table that you never explicitly created.

@cannikin I am 👍 for this -- one of the first things I do in any new CRWA is remove this model.

@jacebenson
Copy link
Contributor

I'm all for it. If we would rather have better control of the error we could introspect the models, but I think that would be a bit over the top.

I am 👍 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Next Sprint Candidates
Development

No branches or pull requests

3 participants