redwood
redwood copied to clipboard
[RFC]: Remove default UserExample model in newly generated Redwood app
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:
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?
- [X] I'm interested in working on this