forked from thedevs-network/kutt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknexfile.js
More file actions
28 lines (25 loc) · 768 Bytes
/
knexfile.js
File metadata and controls
28 lines (25 loc) · 768 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
// this configuration is for migrations only
// and since jwt secret is not required, it's set to a placehodler string to bypass env validation
if (!process.env.JWT_SECRET) {
process.env.JWT_SECRET = "securekey";
}
const env = require("./server/env");
const isSQLite = env.DB_CLIENT === "sqlite3" || env.DB_CLIENT === "better-sqlite3";
module.exports = {
client: env.DB_CLIENT,
connection: {
...(isSQLite && { filename: env.DB_FILENAME }),
host: env.DB_HOST,
database: env.DB_NAME,
user: env.DB_USER,
port: env.DB_PORT,
password: env.DB_PASSWORD,
ssl: env.DB_SSL,
},
useNullAsDefault: true,
migrations: {
tableName: "knex_migrations",
directory: "server/migrations",
disableMigrationsListValidation: true,
}
};