tududi/backend/config/database.js
Antonis Anastasiadis c24bff1882
Parallelize test running (#166)
* Allow specifying DB file explicitely.

* Export config getter/setter instead of object

Allows dynamically changing configuration

* Remove maxWorker Jest limit, parallelize tests

* Remove unnecessary slow step in Dockerfile.

* Correct error response during login

* Fix setting DB permissions in docker entrypoint

---------

Co-authored-by: antanst <>
2025-07-16 13:27:57 +03:00

40 lines
988 B
JavaScript

require('dotenv').config();
const path = require('path');
const { setConfig, getConfig } = require('../config/config');
const config = getConfig();
module.exports = {
development: {
dialect: 'sqlite',
storage: config.dbFile,
logging: console.log,
define: {
timestamps: true,
underscored: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
},
},
test: {
dialect: 'sqlite',
storage: config.dbFile,
logging: false,
define: {
timestamps: true,
underscored: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
},
},
production: {
dialect: 'sqlite',
storage: config.dbFile,
logging: false,
define: {
timestamps: true,
underscored: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
},
},
};