Skip to content

Commit

Permalink
test(client): multiSchema, test same table name (#15647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 authored and jkomyno committed Dec 21, 2022
1 parent 44fe56d commit 3a27107
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/client/tests/functional/multi-schema/_matrix.ts
Expand Up @@ -12,7 +12,10 @@ export default defineMatrix(() => [
],
[
{
mapTable: true,
mapTable: 'IDENTICAL_NAMES',
},
{
mapTable: 'DIFFERENT_NAMES',
},
{
mapTable: false,
Expand Down
Expand Up @@ -2,6 +2,9 @@ import { idForProvider } from '../../_utils/idForProvider'
import testMatrix from '../_matrix'

export default testMatrix.setupSchema(({ provider, mapTable }) => {
const mapTableUser = mapTable === 'IDENTICAL_NAMES' ? 'some_table' : 'some_table_user'
const mapTablePost = mapTable === 'IDENTICAL_NAMES' ? 'some_table' : 'some_table_post'

return /* Prisma */ `
generator client {
provider = "prisma-client-js"
Expand All @@ -20,7 +23,7 @@ model User {
posts Post[]
@@schema("base")
${mapTable ? '@@map("some_table-1")' : ''}
${mapTable ? `@@map("${mapTableUser}")` : ''}
}
model Post {
Expand All @@ -30,7 +33,7 @@ model Post {
author User? @relation(fields: [authorId], references: [id])
@@schema("transactional")
${mapTable ? '@@map("some_table-2")' : ''}
${mapTable ? `@@map("${mapTablePost}")` : ''}
}
`
})

0 comments on commit 3a27107

Please sign in to comment.