Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bloo/f6d448c13bf9cd5af2ff6f98026dca8f to your computer and use it in GitHub Desktop.
Save bloo/f6d448c13bf9cd5af2ff6f98026dca8f to your computer and use it in GitHub Desktop.
Resilient Tech Blog - Code-first GraphQL with Nexus - prisma.schema
// prisma.schema
generator prisma_client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Nonprofit {
id String @id @default(@uuid())
name String?
Budget Budget[]
type NonprofitType
}
model Budget {
id String @id @default(@uuid())
nonprofitId String
fiscalYearStart DateTime
fiscalYearEnd DateTime
amount Int
name String
Nonprofit Nonprofit @relation(fields: [nonprofitId], references: [id])
}
enum NonprofitType {
501c3
501k
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment