redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.27k stars 991 forks source link

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

Open cannikin opened 4 months ago

cannikin commented 4 months ago

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

Are you interested in working on this?

dthyresson commented 1 week 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.

jacebenson commented 1 week ago

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