10
10
use Illuminate \Support \Facades \DB ;
11
11
use Illuminate \Support \Facades \Schema ;
12
12
use Symfony \Component \Console \Attribute \AsCommand ;
13
+ use function Laravel \Prompts \table ;
13
14
14
15
/**
15
16
* Inspired by @see https://medium.com/beyn-technology/ill-never-forget-this-number-4294967295-0xffffffff-c9ad4b72f53a
@@ -101,7 +102,7 @@ public function handle(ConnectionResolverInterface $connections): int
101
102
$ outputTable = [];
102
103
103
104
foreach (Schema::getTables () as $ table ) {
104
- $ riskyColumnsInfo = $ this ->processTable (Arr:: get ( $ table, ' name ' ) , $ connection , $ thresholdAlarmPercentage );
105
+ $ riskyColumnsInfo = $ this ->processTable ($ table , $ connection , $ thresholdAlarmPercentage );
105
106
if (is_array ($ riskyColumnsInfo )) {
106
107
$ outputTable = [...$ outputTable , ...$ riskyColumnsInfo ];
107
108
}
@@ -125,11 +126,12 @@ public function handle(ConnectionResolverInterface $connections): int
125
126
/**
126
127
* @return list<array<string, string>>|null
127
128
*/
128
- private function processTable (string $ tableName , Connection $ connection , float $ thresholdAlarmPercentage ): ?array
129
+ private function processTable (array $ table , Connection $ connection , float $ thresholdAlarmPercentage ): ?array
129
130
{
131
+ $ tableName = Arr::get ($ table , 'name ' );
130
132
$ this ->comment ("Table {$ connection ->getDatabaseName ()}. {$ tableName }: checking... " , 'v ' );
131
133
132
- $ tableSize = $ this -> getTableSize ( $ connection , $ tableName );
134
+ $ tableSize = Arr:: get ( $ table , ' size ' );
133
135
134
136
if ($ tableSize === null ) {
135
137
$ tableSize = -1 ; // not critical info, we can skip this issue
0 commit comments