-
Notifications
You must be signed in to change notification settings - Fork 0
/
drizzle.config.ts
47 lines (33 loc) · 882 Bytes
/
drizzle.config.ts
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { defineConfig } from 'drizzle-kit';
import * as fs from 'fs';
import * as path from 'path';
function loadEnv() {
const envPath = path.resolve(__dirname, '.env.local');
const envData = fs.readFileSync(envPath, 'utf8');
const envVariables = envData.split('\n');
envVariables.forEach(variable => {
const [key, value] = variable.split('=');
if (key && value) {
process.env[key.trim()] = value.trim();
}
});
}
loadEnv();
export default defineConfig({
schema: './app/schema.ts',
out: './migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.NEXT_PUBLIC_DATABASE_URL!,
},
});
/* import { defineConfig } from "drizzle-kit";
export default defineConfig({
schema: "./app/schema.ts",
out: "./migrations",
dialect: "postgresql",
dbCredentials: {
url: process.env.NEXT_PUBLIC_DATABASE_URL!,
},
});
*/