-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknexfile.js
More file actions
47 lines (43 loc) · 984 Bytes
/
knexfile.js
File metadata and controls
47 lines (43 loc) · 984 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
42
43
44
45
46
47
/* eslint-disable import/no-extraneous-dependencies */
const { loadEnvConfig } = require("@next/env");
const path = require("path")
// Adapted from NextJS knex example
const dev = process.env.NODE_ENV !== "production";
const { DATABASE_URL } = loadEnvConfig("./", dev).combinedEnv;
const defaultSettings = {
migrations: {
directory: path.resolve(__dirname, "./panthers-pool/knex/migrations"),
},
seeds: {
directory: path.resolve(__dirname, "./panthers-pool/knex/seeds"),
},
};
module.exports = {
/*
development: {
...defaultSettings,
client: "pg",
connection: {
connectionString: DATABASE_URL,
},
},
*/
development: {
...defaultSettings,
client: "sqlite3",
connection: {
filename: path.resolve(__dirname, "./db.sqlite"),
},
useNullAsDefault: true,
},
/*
production: {
...defaultSettings,
client: "pg",
connection: {
connectionString: DATABASE_URL,
ssl: true,
},
},
*/
};