add cert support to knex migration

This commit is contained in:
Maidul Islam
2024-02-29 14:37:01 -05:00
parent 553b56e57e
commit 96887cdbfa
+18 -2
View File
@@ -17,7 +17,15 @@ dotenv.config({
export default { export default {
development: { development: {
client: "postgres", client: "postgres",
connection: process.env.DB_CONNECTION_URI, connection: {
connectionString: process.env.DB_CONNECTION_URI,
ssl: process.env.DB_ROOT_CERT
? {
rejectUnauthorized: true,
ca: Buffer.from(process.env.DB_ROOT_CERT, "base64").toString("ascii")
}
: false
},
pool: { pool: {
min: 2, min: 2,
max: 10 max: 10
@@ -31,7 +39,15 @@ export default {
}, },
production: { production: {
client: "postgres", client: "postgres",
connection: process.env.DB_CONNECTION_URI, connection: {
connectionString: process.env.DB_CONNECTION_URI,
ssl: process.env.DB_ROOT_CERT
? {
rejectUnauthorized: true,
ca: Buffer.from(process.env.DB_ROOT_CERT, "base64").toString("ascii")
}
: false
},
pool: { pool: {
min: 2, min: 2,
max: 10 max: 10