Best practice for adding properties to User entity?
I'm looking at adding a property called isCreator to the existing user entity that comes with OpenSaaS, but when I do it and attempt to migrate the db I get this error
I'm sure it's something I've done wrong as I am not to familiar with prisma!
4 Replies
Hi @CamBlackwood. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the error message you provided, it seems like you've added the
isCreator
property to your User entity in your Prisma schema, but you haven't updated the seeding script (usersSeed.ts
) to include this new property when creating new User records.
To fix this, you'll need to update your usersSeed.ts
file to include the isCreator
property when creating new User records. Here's an example of how you might do this:
Remember to replace the example values with actual values that make sense for your application.
For more information on how to define entities in Wasp, you can refer to the official Wasp documentation (https://wasp-lang.dev/docs/data-model/entities). This guide explains how to use the Prisma Schema Language (PSL) to define your data models, which is what you'll need to do to add the isCreator
property to your User entity.
If you're still having trouble, don't hesitate to ask for more help!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?worked like a charm, thank you bot ❤️
Wohooo @CamBlackwood, you just became a Waspeteer level 2!
Good bot 😄