Skip to content

Commit

Permalink
Update prisma monorepo to v3 (major) (#6490)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Sep 20, 2021
1 parent 0e9994b commit ca48072
Show file tree
Hide file tree
Showing 39 changed files with 185 additions and 208 deletions.
8 changes: 8 additions & 0 deletions .changeset/poor-pens-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@keystone-next/keystone': major
'@keystone-next/prisma-utils': major
---

Updated Prisma package dependencies to `3.0.2`. See the [Prisma release notes](https://github.com/prisma/prisma/releases/tag/3.0.1) for full details of the changes.

Note that Keystone continues to use the "binary" query engine, rather than the new "node-API" query engine, which is now the Prisma default. We are still performing tests to ensure that the node-API query engine will work well with Keystone.
5 changes: 5 additions & 0 deletions .changeset/small-teachers-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone': major
---

Removed `filters.postgresql.Json` export from `@keystone-next/keystone/types`. Note this is unrelated to the `json` field type. The `json` field type did not have filters and still does not.
5 changes: 3 additions & 2 deletions examples-staging/assets-cloud/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/assets-local/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model User {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/basic/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model User {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/ecommerce/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model User {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/embedded-nextjs/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/graphql-api-endpoint/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource postgresql {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model User {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/roles/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Todo {
Expand Down
5 changes: 3 additions & 2 deletions examples-staging/sandbox/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Todo {
Expand Down
5 changes: 3 additions & 2 deletions examples/blog/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-admin-ui-logo/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-admin-ui-navigation/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-admin-ui-pages/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-field-view/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples/default-values/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/document-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples/extend-graphql-schema/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples/json/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Package {
Expand Down
5 changes: 3 additions & 2 deletions examples/task-manager/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/testing/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
5 changes: 3 additions & 2 deletions examples/virtual-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Post {
Expand Down
5 changes: 3 additions & 2 deletions examples/with-auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Task {
Expand Down
8 changes: 4 additions & 4 deletions packages/keystone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"@keystone-ui/toast": "^4.0.3",
"@keystone-ui/tooltip": "^4.0.2",
"@preconstruct/next": "^3.0.0",
"@prisma/client": "2.30.3",
"@prisma/migrate": "2.30.3",
"@prisma/sdk": "2.30.3",
"@prisma/client": "3.0.2",
"@prisma/migrate": "3.0.2",
"@prisma/sdk": "3.0.2",
"@sindresorhus/slugify": "^1.1.2",
"@types/apollo-upload-client": "14.1.0",
"@types/babel__core": "^7.1.16",
Expand Down Expand Up @@ -111,7 +111,7 @@
"pirates": "^4.0.1",
"pluralize": "^8.0.0",
"prettier": "^2.4.0",
"prisma": "2.30.3",
"prisma": "3.0.2",
"prompts": "^2.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { json } from '..';
import { KeystoneContext } from '../../../../types';

export const name = 'Json';
export const typeFunction = json;
Expand All @@ -13,14 +14,14 @@ export const fieldName = 'testField';

export const getTestFields = () => ({ testField: json() });

export const initItems = () => {
export const initItems = (_: any, context: KeystoneContext) => {
return [
{ name: 'a', testField: { a: [] } },
{ name: 'b', testField: { b: 'string' } },
{ name: 'c', testField: { c: 42 } },
{ name: 'd', testField: { d: { i: 25 } } },
{ name: 'e', testField: { e: null } },
{ name: 'f', testField: null },
{ name: 'f', testField: context.prisma.DbNull },
{ name: 'g' },
];
};
Expand Down
1 change: 1 addition & 0 deletions packages/keystone/src/lib/core/prisma-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ datasource ${provider} {
generator client {
provider = "prisma-client-js"
output = "${clientDir}"${prismaFlags}
engineType = "binary"
}
\n`;
for (const [listKey, { resolvedDbFields }] of Object.entries(lists)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ datasource sqlite {
}

generator client {
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
provider = "prisma-client-js"
output = "node_modules/.prisma/client"
engineType = "binary"
}

model Todo {
Expand Down
4 changes: 1 addition & 3 deletions packages/keystone/src/scripts/tests/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ async function getGeneratedMigration(
const migrations: {
migration_name: string;
finished_at: string;
}[] = await prismaClient.$queryRaw(
'SELECT migration_name,finished_at FROM _prisma_migrations ORDER BY finished_at DESC'
);
}[] = await prismaClient.$queryRaw`SELECT migration_name,finished_at FROM _prisma_migrations ORDER BY finished_at DESC`;
await prismaClient.$disconnect();
expect(migrations).toHaveLength(expectedNumberOfMigrations);
expect(migrations.every(x => !!x.finished_at)).toBeTruthy();
Expand Down
Loading

0 comments on commit ca48072

Please sign in to comment.