Skip to content

Commit

Permalink
fix extra space
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Apr 26, 2024
1 parent 921c86f commit 846806c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/Init.ts
Expand Up @@ -67,7 +67,7 @@ datasource db {
case 'mongodb':
schema += `
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
${defaultAttributes}
}
`
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/__tests__/commands/Init.test.ts
Expand Up @@ -258,6 +258,7 @@ test('works with --with-model param cockroachdb', async () => {

const schema = fs.readFileSync(join(ctx.tmpDir, 'prisma', 'schema.prisma'), 'utf-8')
expect(schema).toMatch(defaultSchema({ withModel: true, datasourceProvider: 'cockroachdb' }))
expect(schema).toMatchSnapshot()
})

test('works with generator param - `go run github.com/steebchen/prisma-client-go`', async () => {
Expand Down
Expand Up @@ -156,6 +156,30 @@ https://pris.ly/d/getting-started
"
`;

exports[`works with --with-model param cockroachdb 2`] = `
"// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "cockroachdb"
url = env("DATABASE_URL")
}
model User {
id BigInt @id @default(sequence())
email String @unique
name String?
}
"
`;
exports[`works with --with-model param mongodb 1`] = `
"
✔ Your Prisma schema was created at prisma/schema.prisma
Expand Down Expand Up @@ -194,7 +218,7 @@ datasource db {
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique
name String?
}
Expand Down

0 comments on commit 846806c

Please sign in to comment.