diff --git a/app/Console/Commands/CawanganDebugConnections.php b/app/Console/Commands/CawanganDebugConnections.php index ecf0466..c7cd7be 100644 --- a/app/Console/Commands/CawanganDebugConnections.php +++ b/app/Console/Commands/CawanganDebugConnections.php @@ -82,23 +82,37 @@ class CawanganDebugConnections extends Command $filteredConnections = filterArraysByDatabaseNames($all_cawangan, $all_cawangan_in_config); + $isOK = true; + // checks if there is connection errors - if (Helper::getInactiveCawanganDbConnection() > 0) { + if (sizeof(Helper::getInactiveCawanganDbConnection()) > 0) { dump('Inactive cawangan connection detected : '); + dump('1. Check DB_HOST in .env status is alive and available'); + dump('2. Check database in .env exist in DB_HOST'); + dump(''); dump(Helper::getInactiveCawanganDbConnection()); + $isOK = false; } // checks if config connection do not exist referring to arrahn_master_db if (count($all_cawangan) !== count($all_cawangan_in_config)) { $db_not_config = array_diff(array_column($all_cawangan, 'db_name'), array_column($all_cawangan_in_config, 'database')); - dump(implode(', ', $db_not_config) . ' not configured in database config'); + dump(implode(', ', $db_not_config) . ' exist in arrahn_master_db but not configured in config/database.php'); + $isOK = false; } // checks if config connection databases are not tally fwith arrahn master db if (count($filteredConnections) !== 0) { dump('Database config names are not tally arrahn_master_db : '); dump($filteredConnections); + $isOK = false; } + + if($isOK == true){ + dump('Cawangan database configuration is OK'); + } + + } } diff --git a/config/database.php b/config/database.php index f464311..f00cfca 100644 --- a/config/database.php +++ b/config/database.php @@ -17,6 +17,7 @@ return [ 'prefix' => '', 'strict' => false, ], +<<<<<<< Updated upstream 'mysql37' => [ 'driver' => 'mysql', 'host' => env('DB_HOST_37'), @@ -29,6 +30,8 @@ return [ 'prefix' => '', 'strict' => false, ], +======= +>>>>>>> Stashed changes 'mysql2' => [ 'driver' => 'mysql', 'host' => env('DB_HOST_2'), @@ -425,7 +428,23 @@ return [ 'prefix' => '', 'strict' => false, ], +<<<<<<< Updated upstream 'mysql34' => [ +======= + 'mysql36' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST_36'), + 'port' => env('DB_PORT_36'), + 'database' => env('DB_DATABASE_36'), + 'username' => env('DB_USERNAME_36'), + 'password' => env('DB_PASSWORD_36'), + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + ], + 'mysql34' => [ +>>>>>>> Stashed changes 'driver' => 'mysql', 'host' => env('DB_HOST_34'), 'port' => env('DB_PORT_34'), @@ -437,7 +456,11 @@ return [ 'prefix' => '', 'strict' => false, ], +<<<<<<< Updated upstream 'mysql35' => [ +======= + 'mysql35' => [ +>>>>>>> Stashed changes 'driver' => 'mysql', 'host' => env('DB_HOST_35'), 'port' => env('DB_PORT_35'), @@ -448,6 +471,7 @@ return [ 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, +<<<<<<< Updated upstream ], 'mysql36' => [ 'driver' => 'mysql', @@ -472,6 +496,8 @@ return [ 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, +======= +>>>>>>> Stashed changes ], ], ];