step 1, 2 and 3 of the implementation plan

This commit is contained in:
2026-02-03 09:43:23 +01:00
parent d38001e3e2
commit 3684d9ef6b
34 changed files with 4070 additions and 18 deletions

View File

@@ -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!');