-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprovider.drizzle.config.ts
More file actions
31 lines (29 loc) · 1.42 KB
/
provider.drizzle.config.ts
File metadata and controls
31 lines (29 loc) · 1.42 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
29
30
31
import { defineConfig } from "drizzle-kit";
// @ts-ignore
import JSONBigInt from 'json-bigint'
/*
* Without this "hack" we get a "bigint" error when using JSON.stringify,
* since drizzle-kit uses JSON.stringify to generate the migration files.
*
* The error:
* TypeError: Do not know how to serialize a BigInt
* at JSON.stringify (<anonymous>)
* at diffSchemasOrTables (/home/overlordyorch/Development/igniter/node_modules/.pnpm/drizzle-kit@0.31.4/node_modules/drizzle-kit/bin.cjs:23884:27)
* at applyPgSnapshotsDiff (/home/overlordyorch/Development/igniter/node_modules/.pnpm/drizzle-kit@0.31.4/node_modules/drizzle-kit/bin.cjs:29898:26)
* at async prepareAndMigratePg (/home/overlordyorch/Development/igniter/node_modules/.pnpm/drizzle-kit@0.31.4/node_modules/drizzle-kit/bin.cjs:33887:42)
* at async Object.handler (/home/overlordyorch/Development/igniter/node_modules/.pnpm/drizzle-kit@0.31.4/node_modules/drizzle-kit/bin.cjs:93575:7)
* at async run (/home/overlordyorch/Development/igniter/node_modules/.pnpm/drizzle-kit@0.31.4/node_modules/drizzle-kit/bin.cjs:93059:7)
*
* Ref Issue: https://github.com/drizzle-team/drizzle-orm/issues/1879
*/
JSON.parse = JSONBigInt.parse
JSON.stringify = JSONBigInt.stringify
export default defineConfig({
out: "apps/provider/drizzle",
schema: "packages/db/src/provider/schema",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
ssl: true,
},
});