Skip to content

Commit

Permalink
Use config file to get sequelize to use SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
adunkman committed Sep 1, 2021
1 parent 51f7ce0 commit f0a82dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
13 changes: 2 additions & 11 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
const path = require("path");

const {
DATABASE_URL,
NODE_ENV,
} = process.env;

module.exports = {
"url": DATABASE_URL,
"dialect":"postgres",
"ssl": NODE_ENV === "production",
"dialectOptions": {
"ssl": NODE_ENV === "production"
},
"env": "all",
"config": path.resolve("sequelize-cli.config.js"),
"migrations-path": path.resolve("migrations"),
"models-path": path.resolve("bot", "models"),
}
15 changes: 15 additions & 0 deletions sequelize-cli.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const {
DATABASE_URL,
NODE_ENV,
} = process.env;

module.exports = {
"all": {
"url": DATABASE_URL,
"dialect": "postgres",
"ssl": NODE_ENV === "production",
"dialectOptions": {
"ssl": NODE_ENV === "production"
},
}
}

0 comments on commit f0a82dd

Please sign in to comment.