-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
Description
Description and expected behavior
model Tenant {
id String @id @default(uuid())
users User[]
}
model User {
id String @id @default(uuid())
tenantId String @default(auth().tenantId)
tenant Tenant @relation(fields: [tenantId], references: [id])
@@allow('all', true)
}const tenant = await prisma.tenant.create({
data: {},
});
const user = await prisma.user.create({
data: { tenantId: tenant.id },
});
const db = enhance({ id: user.id, tenantId: tenant.id });
const extendedDb = db.$extends({});
await extendedDb.user.create({
data: {},
});Error:
const result = await tx[this.model].create({
data: {
+ tenant: {
+ create: TenantCreateWithoutUsersInput | TenantUncheckedCreateWithoutUsersInput,
+ connectOrCreate: TenantCreateOrConnectWithoutUsersInput,
+ connect: TenantWhereUniqueInput
+ }
},
select: {
id: true
}
})
Argument `tenant` is missing.
This error does not occur when using the non-extended client