Skip to content

Commit

Permalink
chore(deps): update engines to 4.17.0-25.5f09abedf63bf38cdf856d38d49c…
Browse files Browse the repository at this point in the history
…0699b1f0002b (#20115)

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Co-authored-by: Alexey Orlenko <alex@aqrln.net>
  • Loading branch information
4 people committed Jul 10, 2023
1 parent 46b6240 commit 1b17f29
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 105 deletions.
2 changes: 1 addition & 1 deletion packages/client/package.json
Expand Up @@ -153,7 +153,7 @@
}
},
"dependencies": {
"@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c"
"@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion packages/engines/package.json
Expand Up @@ -8,7 +8,7 @@
"author": "Tim Suchanek <suchanek@prisma.io>",
"devDependencies": {
"@prisma/debug": "workspace:*",
"@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c",
"@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b",
"@prisma/fetch-engine": "workspace:*",
"@prisma/get-platform": "workspace:*",
"@swc/core": "1.3.64",
Expand Down
2 changes: 1 addition & 1 deletion packages/fetch-engine/package.json
Expand Up @@ -15,7 +15,7 @@
"bugs": "https://github.com/prisma/prisma/issues",
"enginesOverride": {},
"devDependencies": {
"@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c",
"@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b",
"@swc/core": "1.3.64",
"@swc/jest": "0.2.26",
"@types/jest": "29.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/internals/package.json
Expand Up @@ -48,7 +48,7 @@
"@prisma/fetch-engine": "workspace:*",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "workspace:*",
"@prisma/prisma-schema-wasm": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c",
"@prisma/prisma-schema-wasm": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b",
"archiver": "5.3.1",
"arg": "5.0.2",
"checkpoint-client": "1.1.24",
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/package.json
Expand Up @@ -17,7 +17,7 @@
"version": "latest"
},
"devDependencies": {
"@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c",
"@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b",
"@prisma/generator-helper": "workspace:*",
"@prisma/internals": "workspace:*",
"@swc/core": "1.3.64",
Expand Down
Expand Up @@ -74,43 +74,6 @@ enum Role {
`;
exports[`cockroachdb basic introspection (with cockroach provider) --url 6`] = `
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = "postgresql://prisma@localhost:26257/tests-migrate-db-pull-cockroachdb"
}
model Post {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @default(dbgenerated("'1970-01-01 00:00:00'::TIMESTAMP"))
published Boolean @default(false)
title String
content String?
authorId String?
jsonData Json?
coinflips Boolean[]
User User? @relation(fields: [authorId], references: [id])
}
model User {
id String @id
email String @unique(map: "User.email")
name String?
Post Post[]
}
enum Role {
USER
ADMIN
}
`;
exports[`cockroachdb basic introspection (with cockroachdb provider) 2`] = `
generator client {
provider = "prisma-client-js"
Expand Down Expand Up @@ -148,39 +111,4 @@ enum Role {
`;
exports[`cockroachdb basic introspection (with postgresql provider) 2`] = `
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("TEST_COCKROACH_URI_MIGRATE")
}
model Post {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @default(dbgenerated("'1970-01-01 00:00:00'::TIMESTAMP"))
published Boolean @default(false)
title String
content String?
authorId String?
jsonData Json?
coinflips Boolean[]
User User? @relation(fields: [authorId], references: [id])
}
model User {
id String @id
email String @unique(map: "User.email")
name String?
Post Post[]
}
enum Role {
USER
ADMIN
}
`;
exports[`cockroachdb basic introspection (with postgresql provider) --url should fail 2`] = ``;
18 changes: 13 additions & 5 deletions packages/migrate/src/__tests__/DbPull/cockroachdb.test.ts
Expand Up @@ -71,12 +71,16 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => {
expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
})

test('basic introspection (with postgresql provider)', async () => {
test('basic introspection (with postgresql provider) should fail', async () => {
ctx.fixture('introspection/cockroachdb')
const introspect = new DbPull()
const result = introspect.parse(['--print', '--schema', 'with-postgresql-provider.prisma'])
await expect(result).resolves.toMatchInlineSnapshot(``)
expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchSnapshot()
await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(`
You are trying to connect to a CockroachDB database, but the provider in your Prisma schema is \`postgresql\`. Please change it to \`cockroachdb\`.
`)
expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
expect(ctx.mocked['console.info'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
})
Expand All @@ -101,7 +105,7 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => {
expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
})

test('basic introspection (with cockroach provider) --url ', async () => {
test('basic introspection (with postgresql provider) --url should fail', async () => {
ctx.fixture('introspection/cockroachdb')
const introspect = new DbPull()
const result = introspect.parse([
Expand All @@ -111,7 +115,11 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => {
'--schema',
'with-postgresql-provider.prisma',
])
await expect(result).resolves.toMatchInlineSnapshot(``)
await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(`
You are trying to connect to a CockroachDB database, but the provider in your Prisma schema is \`postgresql\`. Please change it to \`cockroachdb\`.
`)
expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchSnapshot()
expect(ctx.mocked['console.info'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``)
Expand Down
18 changes: 10 additions & 8 deletions packages/migrate/src/__tests__/rpc.test.ts
Expand Up @@ -515,8 +515,9 @@ describe('markMigrationApplied', () => {
})

describe('schemaPush', () => {
// The Prisma CLI creates the SQLite database file if it doesn't exist before calling the RPC
it('should throw if SQLite database file is missing', async () => {
// Note that the Prisma CLI creates the SQLite database file if it doesn't exist before calling the RPC
// Since 5.0.0 this RPC does not error anymore if the SQLite database file is missing
it('should succeed if SQLite database file is missing', async () => {
ctx.fixture('schema-only-sqlite')
const schemaPath = (await getSchemaPath())!
const migrate = new Migrate(schemaPath)
Expand All @@ -526,12 +527,13 @@ describe('schemaPush', () => {
schema: schema,
})

await expect(result).rejects.toMatchInlineSnapshot(`
P1003
Database dev.db does not exist at dev.db
`)
await expect(result).resolves.toMatchInlineSnapshot(`
{
executedSteps: 1,
unexecutable: [],
warnings: [],
}
`)
migrate.stop()
})

Expand Down
28 changes: 14 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b17f29

Please sign in to comment.