Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update prisma monorepo to v4.3.0 #7868

Merged
merged 7 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/assets-local/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/assets-s3/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ model User {
email String @unique @default("")
password String?
isAdmin Boolean @default(false)
}
}
2 changes: 1 addition & 1 deletion examples/basic/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ model Post {
authorId String? @map("author")

@@index([authorId])
}
}
2 changes: 1 addition & 1 deletion examples/blog/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-logo/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-navigation/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-pages/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/custom-field-view/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/custom-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ model Post {
rating Int?
pair_left String?
pair_right String?
}
}
2 changes: 1 addition & 1 deletion examples/custom-session-validation/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ model Person {
password String
passwordChangedAt DateTime?
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/default-values/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/document-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ model Author {
email String @unique @default("")
posts Post[] @relation("Post_author")
bio String @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")
}
}
2 changes: 1 addition & 1 deletion examples/ecommerce/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ model Role {
canManageCart Boolean @default(false)
canManageOrders Boolean @default(false)
assignedTo User[] @relation("User_role")
}
}
2 changes: 1 addition & 1 deletion examples/embedded-nextjs/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ model Post {
title String @default("")
slug String @default("")
content String @default("")
}
}
2 changes: 1 addition & 1 deletion examples/extend-graphql-schema-graphql-ts/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/extend-graphql-schema-nexus/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/extend-graphql-schema/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/extend-graphql-subscriptions/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/graphql-api-endpoint/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ model Tag {
id String @id @default(cuid())
name String @default("")
posts Post[] @relation("Post_tags")
}
}
2 changes: 1 addition & 1 deletion examples/json/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ model Person {
id String @id @default(cuid())
name String @default("")
packages Package[] @relation("Package_ownedBy")
}
}
2 changes: 1 addition & 1 deletion examples/rest-api/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @unique @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/roles/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ model Role {
canManagePeople Boolean @default(false)
canManageRoles Boolean @default(false)
assignedTo Person[] @relation("Person_role")
}
}
2 changes: 1 addition & 1 deletion examples/task-manager/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ model Person {
id String @id @default(cuid())
name String @unique @default("")
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/testing/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ model Person {
email String @unique @default("")
password String
tasks Task[] @relation("Task_assignedTo")
}
}
2 changes: 1 addition & 1 deletion examples/virtual-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ model Author {
name String @default("")
email String @unique @default("")
posts Post[] @relation("Post_author")
}
}
2 changes: 1 addition & 1 deletion examples/with-auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ model Person {
email String @unique @default("")
password String
tasks Task[] @relation("Task_assignedTo")
}
}
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"@keystone-ui/tooltip": "^6.0.1",
"@nodelib/fs.walk": "^1.2.8",
"@preconstruct/next": "^4.0.0",
"@prisma/client": "4.2.1",
"@prisma/internals": "4.2.1",
"@prisma/migrate": "4.2.1",
"@prisma/client": "4.3.0",
"@prisma/internals": "4.3.0",
"@prisma/migrate": "4.3.0",
"@sindresorhus/slugify": "^1.1.2",
"@types/apollo-upload-client": "17.0.1",
"@types/bcryptjs": "^2.4.2",
Expand Down Expand Up @@ -107,7 +107,7 @@
"p-limit": "^2.3.0",
"pirates": "4.0.4",
"pluralize": "^8.0.0",
"prisma": "4.2.1",
"prisma": "4.3.0",
"prompts": "^2.4.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ generator client {
model Todo {
id String @id @default(cuid())
title String @default("")
}
}
9 changes: 3 additions & 6 deletions packages/core/src/scripts/tests/prisma.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ test('keystone prisma exits with the same code as the prisma child process exits
all: true,
cwd: tmp,
});
expect(result.exitCode).toBe(1);
expect(stripAnsi(result.all!)).toMatchInlineSnapshot(`
"
! Unknown command "bad-thing"
Expand Down Expand Up @@ -60,6 +59,7 @@ test('keystone prisma exits with the same code as the prisma child process exits
$ prisma db push
"
`);
expect(result.exitCode).toBe(1);
});

test('keystone prisma uses the db url in the keystone config', async () => {
Expand All @@ -73,13 +73,10 @@ test('keystone prisma uses the db url in the keystone config', async () => {
all: true,
cwd: tmp,
});
expect(result.exitCode).toBe(0);
expect(stripAnsi(result.all!)).toMatchInlineSnapshot(`
"Prisma schema loaded from schema.prisma
Datasource "sqlite": SQLite database "app.db" at "file:./app.db"

Database connection error:

P1003: Database app.db does not exist at ./app.db"
Error: P1003: Database app.db does not exist at ./app.db"
`);
expect(result.exitCode).toBe(1);
});
4 changes: 2 additions & 2 deletions prisma-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"main": "dist/keystone-6-prisma-utils.cjs.js",
"dependencies": {
"@prisma/generator-helper": "4.2.1",
"@prisma/internals": "4.2.1",
"@prisma/generator-helper": "4.3.0",
"@prisma/internals": "4.3.0",
"fs-extra": "^10.0.0",
"prettier": "^2.5.0"
},
Expand Down
5 changes: 3 additions & 2 deletions tests/api-tests/db-enable-logging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ test(
expect(logs).toEqual([
[
'prisma:query',
dbProvider === 'sqlite'
(dbProvider === 'sqlite'
? 'SELECT `main`.`User`.`id`, `main`.`User`.`name` FROM `main`.`User` WHERE 1=1 LIMIT ? OFFSET ?'
: dbProvider === 'mysql'
? 'SELECT `test_db`.`User`.`id`, `test_db`.`User`.`name` FROM `test_db`.`User` WHERE 1=1'
: 'SELECT "public"."User"."id", "public"."User"."name" FROM "public"."User" WHERE 1=1 OFFSET $1',
: 'SELECT "public"."User"."id", "public"."User"."name" FROM "public"."User" WHERE 1=1 OFFSET $1') +
' /* traceparent=00-00-00-00 */',
dcousens marked this conversation as resolved.
Show resolved Hide resolved
],
]);
} finally {
Expand Down
6 changes: 4 additions & 2 deletions tests/api-tests/db-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ model SomeList {
someField String @default("")

@@map("some_table_name")
}`);
}
`);
});

const testModules = globby.sync(`packages/**/src/**/test-fixtures.{js,ts}`, {
Expand Down Expand Up @@ -110,5 +111,6 @@ generator client {
model SomeList {
id String @id @default(cuid())
someField String @default("") @map("db_map_field")
}`);
}
`);
});
6 changes: 4 additions & 2 deletions tests/api-tests/indexes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ model Test {
other String @default("")

@@index([somethingIndexed])
}`);
}
`);
});

if (dbProvider === 'postgresql') {
Expand Down Expand Up @@ -93,6 +94,7 @@ model Test {
enum TestEnumSelectIndexedType {
a
b
}`);
}
`);
});
}
12 changes: 8 additions & 4 deletions tests/api-tests/relationships/foreign-key.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ model A {
model B {
id String @id @default(cuid())
a A? @relation("A_b")
}`);
}
`);
});

test('when specifying foreignKey: true in a one to one relationship, that side has the foreign key', async () => {
Expand Down Expand Up @@ -87,7 +88,8 @@ model B {
id String @id @default(cuid())
a A? @relation("B_a", fields: [aId], references: [id])
aId String? @unique @map("a")
}`);
}
`);
});

test('when specifying foreignKey: { map } in a one to one relationship, that side has the foreign key with the map', async () => {
Expand Down Expand Up @@ -131,7 +133,8 @@ model B {
id String @id @default(cuid())
a A? @relation("B_a", fields: [aId], references: [id])
aId String? @unique @map("blah")
}`);
}
`);
});

test('when specifying foreignKey: true on both sides of a one to one relationship, an error is thrown', async () => {
Expand Down Expand Up @@ -250,5 +253,6 @@ model B {
aId String? @map("something")

@@index([aId])
}`);
}
`);
});
9 changes: 6 additions & 3 deletions tests/api-tests/relationships/relation-name.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ model A {
model B {
id String @id @default(cuid())
a A[] @relation("A_b")
}`);
}
`);
});

test("the ordering of the lists doesn't affect the relation name", async () => {
Expand Down Expand Up @@ -85,7 +86,8 @@ model A {
model B {
id String @id @default(cuid())
a A[] @relation("A_b")
}`);
}
`);
});

test('when specifying relationName in a many to many relationship, the relation name is set to that', async () => {
Expand Down Expand Up @@ -128,7 +130,8 @@ model A {
model B {
id String @id @default(cuid())
a A[] @relation("the_relation_name")
}`);
}
`);
});

test('when specifying relationName on both sides of a many to many relationship, an error is thrown', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/sandbox/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ model User {
updatedAt DateTime @updatedAt
from_Thing_toOneRelationship Thing[] @relation("Thing_toOneRelationship")
from_Thing_toOneRelationshipCard Thing[] @relation("Thing_toOneRelationshipCard")
}
}
2 changes: 1 addition & 1 deletion tests/test-projects/basic/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ model SecretPlan {
id String @id @default(cuid())
label String @default("")
description String @default("")
}
}
Loading