-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathprisma.config.ts
More file actions
30 lines (26 loc) · 761 Bytes
/
prisma.config.ts
File metadata and controls
30 lines (26 loc) · 761 Bytes
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
29
30
/**
* Prisma configuration file
* See: https://www.prisma.io/docs/orm/reference/prisma-config-reference
*/
import { config } from 'dotenv'
import path from 'node:path'
import { defineConfig } from 'prisma/config'
// Load environment variables from .env file
config()
const databaseUrl = process.env.NUXT_DATABASE_URL
const shadowDatabaseUrl = process.env.NUXT_SHADOW_DATABASE_URL
export default defineConfig({
schema: path.join('server'),
migrations: {
path: path.join('server', 'migrations'),
seed: 'jiti ./server/database/runSeed.ts',
},
...(databaseUrl !== undefined
? {
datasource: {
url: databaseUrl,
...(shadowDatabaseUrl !== undefined ? { shadowDatabaseUrl } : {}),
},
}
: {}),
})