Skip to content

Commit

Permalink
adapt test to test identical and different names for @@ map
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Oct 14, 2022
1 parent f70e4a4 commit abd5786
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export default defineMatrix(() => [
],
[
{
mapTable: true,
mapTable: 'IDENTICAL_NAMES',
},
{
mapTable: 'DIFFERENT_NAMES',
},
{
mapTable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { idForProvider } from '../../_utils/idForProvider'
import testMatrix from '../_matrix'

export default testMatrix.setupSchema(({ provider, mapTable }) => {
const mapTableName1 = mapTable === 'IDENTICAL_NAMES' ? 'some_table' : 'some_table_a'
const mapTableName2 = mapTable === 'IDENTICAL_NAMES' ? 'some_table' : 'some_table_b'

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

0 comments on commit abd5786

Please sign in to comment.