-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
_schema.ts
36 lines (30 loc) · 886 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
36
import { idForProvider } from '../../_utils/idForProvider'
import testMatrix from '../_matrix'
export default testMatrix.setupSchema(({ provider, mapTable }) => {
return /* Prisma */ `
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "${provider}"
url = env("DATABASE_URI_${provider}")
schemas = ["base", "transactional"]
}
model User {
id ${idForProvider(provider)}
email String
posts Post[]
@@schema("base")
${mapTable ? '@@map("some_table")' : ''}
}
model Post {
id ${idForProvider(provider)}
title String
authorId String
author User? @relation(fields: [authorId], references: [id])
@@schema("transactional")
${mapTable ? '@@map("some_table")' : ''}
}
`
})