step 1, 2 and 3 of the implementation plan
This commit is contained in:
@@ -31,7 +31,7 @@ public function handle(): int
|
||||
|
||||
// Get all tables
|
||||
$tables = DB::select('SHOW TABLES');
|
||||
$tableKey = 'Tables_in_' . DB::getDatabaseName();
|
||||
$tableKey = 'Tables_in_'.DB::getDatabaseName();
|
||||
|
||||
$tableNames = [];
|
||||
foreach ($tables as $table) {
|
||||
@@ -43,9 +43,9 @@ public function handle(): int
|
||||
|
||||
// Build markdown content
|
||||
$markdown = "# Database Schema Documentation\n\n";
|
||||
$markdown .= '> Generated: ' . date('Y-m-d H:i:s') . "\n";
|
||||
$markdown .= '> Database: ' . DB::getDatabaseName() . "\n";
|
||||
$markdown .= '> Total Tables: ' . count($tableNames) . "\n\n";
|
||||
$markdown .= '> Generated: '.date('Y-m-d H:i:s')."\n";
|
||||
$markdown .= '> Database: '.DB::getDatabaseName()."\n";
|
||||
$markdown .= '> Total Tables: '.count($tableNames)."\n\n";
|
||||
$markdown .= "## Table of Contents\n\n";
|
||||
|
||||
// Add table of contents
|
||||
@@ -100,7 +100,7 @@ public function handle(): int
|
||||
}
|
||||
|
||||
$markdown .= "| {$column->Field} | {$column->Type} | {$column->Null} | {$column->Key} | ";
|
||||
$markdown .= ($column->Default === null ? 'NULL' : $column->Default) . ' | ';
|
||||
$markdown .= ($column->Default === null ? 'NULL' : $column->Default).' | ';
|
||||
$markdown .= "{$column->Extra} | {$fkInfo} |\n";
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public function handle(): int
|
||||
}
|
||||
|
||||
// Write to file
|
||||
$filePath = $directory . '/schema.md';
|
||||
$filePath = $directory.'/schema.md';
|
||||
File::put($filePath, $markdown);
|
||||
|
||||
$this->info('✅ Schema documentation generated successfully!');
|
||||
|
||||
Reference in New Issue
Block a user