kutt/knexfile.js

29 lines
768 B
JavaScript
Raw Permalink Normal View History

// 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";
}
2024-08-11 18:41:03 +03:30
const env = require("./server/env");
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
module.exports = {
client: env.DB_CLIENT,
connection: {
2025-01-08 09:45:55 +03:30
...(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,
}
};