File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"production" : {
11
11
"use_env_variable" : " DATABASE_URL" ,
12
- "dialect" : " postgres"
12
+ "dialect" : " postgres" ,
13
+ "dialectOptions" : {
14
+ "ssl" : {
15
+ "rejectUnauthorized" : false
16
+ }
17
+ }
13
18
}
14
19
}
Original file line number Diff line number Diff line change @@ -3,14 +3,23 @@ import debug from "debug";
3
3
import Sequelize from "sequelize" ;
4
4
import EncryptedField from "sequelize-encrypted" ;
5
5
6
+ const isProduction = process . env . NODE_ENV === "production" ;
7
+
6
8
export const encryptedFields = ( ) =>
7
9
EncryptedField ( Sequelize , process . env . SECRET_KEY ) ;
8
10
9
11
export const DataTypes = Sequelize ;
10
12
export const Op = Sequelize . Op ;
11
13
12
14
export const sequelize = new Sequelize ( process . env . DATABASE_URL , {
13
- // logging: console.log,
14
15
logging : debug ( "sql" ) ,
15
16
typeValidation : true ,
17
+ dialectOptions : {
18
+ ssl : isProduction
19
+ ? {
20
+ // Ref.: https://github.com/brianc/node-postgres/issues/2009
21
+ rejectUnauthorized : false ,
22
+ }
23
+ : false ,
24
+ } ,
16
25
} ) ;
You can’t perform that action at this time.
0 commit comments