Limit CRUD Create operation to 1

Good Greetings Redwood Community,

I am new to Redwood and do not speak code as fluently as I see some of you guys speak.

I want to create a model Profile that basically includes the user’s profile information. So I created a CRUD of this. However, I don’t want the user to be able to keep on creating profiles but limit the Create of the CRUD to just 1.

They can continue to Read and Update. I did see in tutorial for making comments how you can remove the Delete functionality.

Can someone point me in the right direction?

Much Appreciated.

Thank You

Hi @patel and thanks for using Redwood.

In the database world there a few kinds of relationships between tables or models.

What you describe is a one-to-one relation —- a user has one profile; a profile belongs to one user.

Another is one-to-many - a user has many addresses; and address belongs to a user.

There are others but that’s the most common.

See Prisma’s documentation on relations here One-to-one relations

It describes that User and Profile example in fact.