diff --git a/.gitignore b/.gitignore index 9320a5d..20f118b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ production-server dump.rdb docs/api/static **/.DS_Store +db/* +!db/.gitkeep diff --git a/db/.gitkeep b/db/.gitkeep new file mode 100644 index 0000000..39d4a03 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/knexfile.js b/knexfile.js index c3b4fc3..b8a6dac 100644 --- a/knexfile.js +++ b/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, diff --git a/server/knex.js b/server/knex.js index 7f5e463..4ff3bdc 100644 --- a/server/knex.js +++ b/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,