-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
_schema.ts
35 lines (31 loc) · 916 Bytes
/
_schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { idForProvider } from '../../../_utils/idForProvider'
import testMatrix from '../_matrix'
export default testMatrix.setupSchema(({ provider }) => {
return /* Prisma */ `
generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
}
datasource db {
provider = "${provider}"
url = env("DATABASE_URI_${provider}")
}
model User {
id ${idForProvider(provider)}
email String @unique
name String?
posts Post[]
}
model Post {
id ${idForProvider(provider)}
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String?
published Boolean @default(false)
viewCount Int @default(0)
author User? @relation(fields: [authorId], references: [id])
authorId String?
}
`
})