Skip to content

Instantly share code, notes, and snippets.

@scriptcoded
Created December 12, 2019 13:02
Show Gist options
  • Save scriptcoded/aff820c37339b3d9e7b9ec884cda48b3 to your computer and use it in GitHub Desktop.
Save scriptcoded/aff820c37339b3d9e7b9ec884cda48b3 to your computer and use it in GitHub Desktop.
model Company {
id String @default(cuid()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
workspaceId Int @unique
name String
users User[]
}
model User {
id String @default(cuid()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
workspaceId Int @unique
givenName String?
familyName String?
email String
companies Company[]
}
model CompanyUsers {
id String @id
company Company
user User
roles String[]
}
@scriptcoded
Copy link
Author

@ifndefdeadmau5 It was a mistake and the wrong syntax. See the link below. The syntax here is the correct one :)

https://prisma.slack.com/archives/CKQTGR6T0/p1576156448333900?thread_ts=1576156170.333700&cid=CKQTGR6T0

@matthewmueller
Copy link

yep thanks @scriptcoded. sorry for the confusion!

@ifndefdeadmau5
Copy link

@scriptcoded Thanks for the correction :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment