Hey team <@UESADRKMY>, I have been having issues t...
# prisma-client
m
Hey team @Ryan, I have been having issues that I wasn't able to resolve with seeding my DB. Below is my schema and seed code to create 2 actors. I get this message in my console: `Foreign key constraint failed on the field:
Actor_profileId_fkey (index)
at PrismaClientFetcher.request (C:\fode\mtchero\node_modules\@prisma\client\runtime\index.js7845515). {`
code: 'P2003',
clientVersion: '2.15.0',
meta: { field_name: 'Actor_profileId_fkey (index)' }
}
Here is the console message:
Do I have to create the Profile before the actor?
plus one +1 1
r
@Martïn 👋 You are passing the
profileId
while creating the actor. Does this profile exist in the database?
plus one +1 2
m
My bad! The profile doesn’t exist. Isn’t this suppose to work since the profileId and Profile are optional? Thanks @Ryan PS: I am seeding over 55 models and this is really hitting me hard
💯 2
r
As they are optional, you can omit it. If you provide it, it needs to exist.