Benjamin FROLICHER
07/21/2022, 2:01 PMBenjamin FROLICHER
07/21/2022, 2:05 PMmodel Organization {
id String @id @db.Uuid @default(uuid())
name String
email String @unique
teams Team[]
}
model Team {
id String @id @db.Uuid @default(uuid()) @unique
name String
avatar Bytes?
Organization Organization @relation(fields: [organizationId], references: [id])
organizationId String @db.Uuid
users UserInTeams[]
}
model User {
id String @id @db.Uuid @default(uuid()) @unique
firstname String
lastname String
email String @unique
teams UserInTeams[]
organizations UserInOrganization[]
}
To add organizations i have to create some Team
const organizations = [
{
name: "Google",
email: "<mailto:contact@google.com|contact@google.com>",
teams :{
create: [
{ name: "Best team" },
{ name: "Rockstar" },
]
},
}
]
async function main() {
await prisma.organization.createMany({ data: organizations })
}
Benjamin FROLICHER
07/21/2022, 2:07 PMteams
in data.0.teams for type OrganizationCreateManyInput. Did you mean name
? Available args:`
So i can't create multiple organization at once.Austin
07/21/2022, 6:53 PMcreateMany
. We have an outstanding feature request for it, so feel free to add a +1 and your specific use case, if it hasn’t been covered already. This helps our engineering teams prioritize for the future!Benjamin FROLICHER
07/26/2022, 4:28 PM