Răsfoiți Sursa

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

Pouria Ezzati 1 an în urmă
părinte
comite
278ae08476
4 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 2 0
      .gitignore
  2. 2 0
      db/.gitkeep
  3. 1 1
      knexfile.js
  4. 1 1
      server/knex.js

+ 2 - 0
.gitignore

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

+ 2 - 0
db/.gitkeep

@@ -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

+ 1 - 1
knexfile.js

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

+ 1 - 1
server/knex.js

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