Skip to content

Commit c452c5f

Browse files
committed
Prismaのバージョンを6.19.0から7.1.0にアップデート
1 parent 5c605c9 commit c452c5f

File tree

8 files changed

+1301
-783
lines changed

8 files changed

+1301
-783
lines changed

docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import express from "express";
22
import cors from "cors";
3+
import { PrismaPg } from "@prisma/adapter-pg";
34
import { PrismaClient } from "./generated/prisma/client.js";
45

56
const app = express();
6-
const client = new PrismaClient();
7+
8+
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
9+
const client = new PrismaClient({ adapter });
10+
711
app.use(express.json());
812
app.use(cors({ origin: process.env.WEB_ORIGIN }));
913

docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/package-lock.json

Lines changed: 1046 additions & 271 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
},
99
"devDependencies": {
1010
"@types/cors": "^2.8.19",
11-
"@types/express": "^5.0.5",
12-
"prisma": "^6.19.0",
13-
"tsx": "^4.20.6",
11+
"@types/express": "^5.0.6",
12+
"@types/pg": "^8.15.6",
13+
"prisma": "^7.1.0",
14+
"tsx": "^4.21.0",
1415
"typescript": "^5.9.3"
1516
},
1617
"dependencies": {
17-
"@prisma/client": "^6.19.0",
18+
"@prisma/adapter-pg": "^7.1.0",
19+
"@prisma/client": "^7.1.0",
1820
"cors": "^2.8.5",
1921
"dotenv": "^17.2.3",
20-
"express": "^5.1.0"
22+
"express": "^5.2.1",
23+
"pg": "^8.16.3"
2124
}
2225
}

docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/prisma.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This file was generated by Prisma and assumes you have installed the following:
2+
// npm install --save-dev prisma dotenv
13
import "dotenv/config";
24
import { defineConfig, env } from "prisma/config";
35

@@ -6,7 +8,6 @@ export default defineConfig({
68
migrations: {
79
path: "prisma/migrations",
810
},
9-
engine: "classic",
1011
datasource: {
1112
url: env("DATABASE_URL"),
1213
},

docs/4-advanced/05-integration-and-deployment/_samples/fullstack-app/backend/prisma/schema.prisma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ generator client {
1111

1212
datasource db {
1313
provider = "postgresql"
14-
url = env("DATABASE_URL")
1514
}
1615

1716
model Post {

0 commit comments

Comments
 (0)