```Users_Runs_ad_idToUsers: { conn...
# orm-help
a
Copy code
Users_Runs_ad_idToUsers: {
                connectOrCreate: {
                    where: { discord: obj.ad.id },
                    create: { 
                        Servers: {
                            connect: { server_id: await getServer(obj.ad.nickname) }
                        },
                        discord: obj.ad.id,
                        payout_char: obj.ad.nickname,
                        balance: 0,
                        Ranks: {
                            connect: { id: 4 }
                        }
                    }
                }
            }
Something like this
r
Hey @Alex Reyne 👋 Yes it’s possible to do a
connect
inside a
connectOrCreate
. What’s the issue you’re facing?
a
Hey, yes
Sorry, I wasn't on my PC when you responded, 3 AM here lol
@Ryan Sorry, I don't know if I was supposed to tag you or not!
r
From a glance, it seems that a foreign key is not available. Could you double check if the values passed to
connect
are correct? If you’re still facing an issue, then you could share your
schema.prisma
and query you were making so I could try to reproduce 🙂
a
Hey, I've sent that in a DM @Ryan