sleep-tracker-backend/knexfile.js
2019-08-02 01:32:51 +02:00

65 lines
1.1 KiB
JavaScript

require("dotenv").config();
module.exports = {
development: {
client: "sqlite3",
useNullAsDefault: true,
connection: {
filename: "./data/sleep-tracker.db3"
},
pool: {
afterCreate: (conn, done) => {
conn.run("PRAGMA foreign_keys = ON", done);
}
},
migrations: {
directory: "./data/migrations"
},
seeds: {
directory: "./data/seeds"
}
},
testing: {
client: "sqlite3",
useNullAsDefault: true,
connection: {
filename: "./data/test.db3"
},
pool: {
afterCreate: (conn, done) => {
conn.run("PRAGMA foreign_keys = ON", done);
}
},
migrations: {
directory: "./data/migrations"
},
seeds: {
directory: "./data/seeds"
}
},
production: {
client: "postgresql",
useNullAsDefault: true,
connection: {
database: process.env.PROD_DB,
user: process.env.PROD_DB_USERNAME,
password: process.env.PROD_DB_PASSWORD
},
pool: {
afterCreate: (conn, done) => {
conn.run("PRAGMA foreign_keys = ON", done);
}
},
migrations: {
directory: "./data/migrations"
},
seeds: {
directory: "./data/seeds"
}
}
};