add db folder and point database files for sqlite to this folder

This commit is contained in:
Pouria Ezzati 2024-09-24 07:34:06 +03:30
parent 7c14663854
commit 278ae08476
No known key found for this signature in database
4 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@ production-server
dump.rdb dump.rdb
docs/api/static docs/api/static
**/.DS_Store **/.DS_Store
db/*
!db/.gitkeep

2
db/.gitkeep Normal file
View File

@ -0,0 +1,2 @@
# keep this folder in git
# if you use a file-based databases such as sqlite3, the database files would be stored here

View File

@ -4,7 +4,7 @@ module.exports = {
production: { production: {
client: env.DB_CLIENT, client: env.DB_CLIENT,
connection: { connection: {
filename: env.DB_FILENAME, filename: "db/" + env.DB_FILENAME,
host: env.DB_HOST, host: env.DB_HOST,
database: env.DB_NAME, database: env.DB_NAME,
user: env.DB_USER, user: env.DB_USER,

View File

@ -5,7 +5,7 @@ const env = require("./env");
const db = knex({ const db = knex({
client: env.DB_CLIENT, client: env.DB_CLIENT,
connection: { connection: {
filename: env.DB_FILENAME, filename: "db/" + env.DB_FILENAME,
host: env.DB_HOST, host: env.DB_HOST,
port: env.DB_PORT, port: env.DB_PORT,
database: env.DB_NAME, database: env.DB_NAME,