-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknexfile.js
More file actions
41 lines (37 loc) · 895 Bytes
/
knexfile.js
File metadata and controls
41 lines (37 loc) · 895 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
31
32
33
34
35
36
37
38
39
40
41
import dotenv from 'dotenv';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
dotenv.config();
const __dirname = dirname(fileURLToPath(import.meta.url));
const knexConfig = {
production: {
client: 'pg',
connection: {
host: process.env.PG_HOST,
port: process.env.PG_PORT,
user: process.env.PG_USER,
password: process.env.PG_PASSWORD,
database: process.env.PG_DATABASE,
},
migrations: {
directory: `${__dirname}/db/migrations`,
},
seeds: {
directory: `${__dirname}/db/seeds`,
},
},
development: {
client: 'sqlite3',
connection: {
filename: `${__dirname}/db/sqlite.db`,
},
migrations: {
directory: `${__dirname}/db/migrations`,
},
seeds: {
directory: `${__dirname}/db/seeds`,
},
useNullAsDefault: true,
},
};
export default knexConfig;