25 lines
529 B
TypeScript
25 lines
529 B
TypeScript
import path from 'path'
|
|
|
|
import type { Knex } from 'knex'
|
|
|
|
// Update with your config settings.
|
|
|
|
// this `data` folder should be mounted in the docker-compose in production, or mkdired in development
|
|
const dbPath = path.join(process.env.DB_PREFIX ?? '../data/', '/database.db')
|
|
const baseConfig = {
|
|
client: 'better-sqlite3',
|
|
connection: {
|
|
filename: dbPath,
|
|
},
|
|
}
|
|
|
|
const config: { [key: string]: Knex.Config } = {
|
|
development: baseConfig,
|
|
|
|
staging: baseConfig,
|
|
|
|
production: baseConfig
|
|
|
|
};
|
|
|
|
module.exports = config;
|