forked from formbricks/formbricks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprisma.config.mjs
More file actions
28 lines (26 loc) · 1.09 KB
/
Copy pathprisma.config.mjs
File metadata and controls
28 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import "dotenv/config";
// Plain object instead of `defineConfig({...})`. `defineConfig` is only a
// typed identity helper and `env(name)` is sugar for `process.env[name]`
// resolved at CLI invocation, so behavior is identical for our use.
//
// NOTE: this does NOT remove `@prisma/config` from the runtime image —
// the Prisma CLI itself hard-requires `@prisma/config` (and its chain:
// c12, effect, fast-check, valibot, ~30 modules / ~48 MB) at module load,
// regardless of what our config file imports. The bloat is unavoidable
// as long as `prisma migrate deploy` runs inside the container. The real
// fix is to relocate migrations to a dedicated step (K8s Job, init
// container, or CI deploy stage) and ship a runtime image with no Prisma
// CLI at all.
export default {
schema: "packages/database/schema.prisma",
migrations: {
path: "packages/database/migrations",
seed: "tsx packages/database/src/seed.ts",
},
datasource: {
url: process.env.DATABASE_URL,
...(process.env.SHADOW_DATABASE_URL && {
shadowDatabaseUrl: process.env.SHADOW_DATABASE_URL,
}),
},
};