@@ -25,6 +25,12 @@ const configure = () => {
2525
2626 if ( configData ?. database ) {
2727 logger . info ( `Using configuration from file: ${ filename } ` ) ;
28+
29+ // Migrate those who have "mysql" engine to "mysql2"
30+ if ( configData . database . engine === "mysql" ) {
31+ configData . database . engine = mysqlEngine ;
32+ }
33+
2834 instance = configData ;
2935 instance . keys = getKeys ( ) ;
3036 return ;
@@ -33,12 +39,12 @@ const configure = () => {
3339
3440 const toBool = ( v ) => / ^ ( 1 | t r u e | y e s | o n ) $ / i. test ( ( v || '' ) . trim ( ) ) ;
3541
36- const envMysqlHost = process . env . DB_MYSQL_HOST || null ;
37- const envMysqlUser = process . env . DB_MYSQL_USER || null ;
38- const envMysqlName = process . env . DB_MYSQL_NAME || null ;
39- const envMysqlSSL = toBool ( process . env . DB_MYSQL_SSL ) ;
40- const envMysqlSSLRejectUnauthorized = process . env . DB_MYSQL_SSL_REJECT_UNAUTHORIZED === undefined ? true : toBool ( process . env . DB_MYSQL_SSL_REJECT_UNAUTHORIZED ) ;
41- const envMysqlSSLVerifyIdentity = process . env . DB_MYSQL_SSL_VERIFY_IDENTITY === undefined ? true : toBool ( process . env . DB_MYSQL_SSL_VERIFY_IDENTITY ) ;
42+ const envMysqlHost = process . env . DB_MYSQL_HOST || null ;
43+ const envMysqlUser = process . env . DB_MYSQL_USER || null ;
44+ const envMysqlName = process . env . DB_MYSQL_NAME || null ;
45+ const envMysqlSSL = toBool ( process . env . DB_MYSQL_SSL ) ;
46+ const envMysqlSSLRejectUnauthorized = process . env . DB_MYSQL_SSL_REJECT_UNAUTHORIZED === undefined ? true : toBool ( process . env . DB_MYSQL_SSL_REJECT_UNAUTHORIZED ) ;
47+ const envMysqlSSLVerifyIdentity = process . env . DB_MYSQL_SSL_VERIFY_IDENTITY === undefined ? true : toBool ( process . env . DB_MYSQL_SSL_VERIFY_IDENTITY ) ;
4248 if ( envMysqlHost && envMysqlUser && envMysqlName ) {
4349 // we have enough mysql creds to go with mysql
4450 logger . info ( "Using MySQL configuration" ) ;
0 commit comments