Open cannikin opened 4 months ago
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 :+1: for this -- one of the first things I do in any new CRWA is remove this model.
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
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 yourschema.prisma
file. Sinceprisma generate
was automatically invoked every time you ranyarn 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
schema.prisma
template in the create-redwood-app packageschema.prisma
Are you interested in working on this?