65 lines
1.1 KiB
JavaScript
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"
|
|
}
|
|
}
|
|
|
|
};
|