2025-01-06 17:02:24 +03:30
|
|
|
// this configuration is for migrations only
|
|
|
|
// and since jwt secret is not required, it's set to a placehodler string to bypass env validation
|
2025-01-08 09:46:12 +03:30
|
|
|
if (!process.env.JWT_SECRET) {
|
|
|
|
process.env.JWT_SECRET = "securekey";
|
2025-01-06 17:02:24 +03:30
|
|
|
}
|
|
|
|
|
2024-08-11 18:41:03 +03:30
|
|
|
const env = require("./server/env");
|
2020-02-15 16:56:06 +03:30
|
|
|
|
2024-10-08 09:26:48 +03:30
|
|
|
const isSQLite = env.DB_CLIENT === "sqlite3" || env.DB_CLIENT === "better-sqlite3";
|
2024-10-07 14:35:47 +03:30
|
|
|
|
2020-02-15 16:56:06 +03:30
|
|
|
module.exports = {
|
2024-09-25 15:44:18 +03:30
|
|
|
client: env.DB_CLIENT,
|
|
|
|
connection: {
|
2025-01-08 09:45:55 +03:30
|
|
|
...(isSQLite && { filename: env.DB_FILENAME }),
|
2024-09-25 15:44:18 +03:30
|
|
|
host: env.DB_HOST,
|
|
|
|
database: env.DB_NAME,
|
|
|
|
user: env.DB_USER,
|
|
|
|
port: env.DB_PORT,
|
|
|
|
password: env.DB_PASSWORD,
|
|
|
|
ssl: env.DB_SSL,
|
|
|
|
},
|
2024-09-25 16:33:43 +03:30
|
|
|
useNullAsDefault: true,
|
2024-09-25 15:44:18 +03:30
|
|
|
migrations: {
|
|
|
|
tableName: "knex_migrations",
|
|
|
|
directory: "server/migrations",
|
|
|
|
disableMigrationsListValidation: true,
|
2020-02-15 16:56:06 +03:30
|
|
|
}
|
|
|
|
};
|