-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathprisma.config.ts
More file actions
23 lines (21 loc) · 1 KB
/
prisma.config.ts
File metadata and controls
23 lines (21 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import "dotenv/config";
import path from "node:path";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: path.join("src", "db", "schema.prisma"),
migrations: {
path: path.join("src", "db", "migrations"),
seed: "tsx scripts/seed.ts",
},
datasource: {
// Generally should not be pooled, because this is used for migrations.
// See https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7#prisma-schema-changes.
// Also: using process.env with fallback instead of env() helper so that `prisma generate`
// works in CI without a real database URL (since it doesn't actually connect to the DB).
url: process.env.DIRECT_URL ?? "",
// should only be set during `generateMigration` because we need to handle the shadow db
// manually for the diffing that the script does. otherwise this should be undefined so that
// prisma can handle the shadow db.
shadowDatabaseUrl: process.env.SHADOW_DATABASE_URL,
},
});