2019-07-31 18:38:48 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-08-01 23:23:01 +00:00
|
|
|
test: {
|
2019-07-31 18:38:48 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|