diff --git a/.gitignore b/.gitignore index e427ff3..0ba1b12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ */node_modules/ */build/ +db/.install_lock diff --git a/admin_dashboard.php b/admin_dashboard.php index 0b2f350..862c0b0 100644 --- a/admin_dashboard.php +++ b/admin_dashboard.php @@ -11,17 +11,27 @@ $users_count = 0; $lpas_count = 0; $users = []; $lpas = []; +$migration_history = []; try { + $db = db(); // Get stats - $users_count = db()->query("SELECT COUNT(*) FROM users")->fetchColumn(); - $lpas_count = db()->query("SELECT COUNT(*) FROM lpa_applications")->fetchColumn(); + $users_count = $db->query("SELECT COUNT(*) FROM users")->fetchColumn(); + $lpas_count = $db->query("SELECT COUNT(*) FROM lpa_applications")->fetchColumn(); // Get all users - $users = db()->query("SELECT * FROM users ORDER BY created_at DESC LIMIT 50")->fetchAll(); + $users = $db->query("SELECT * FROM users ORDER BY created_at DESC LIMIT 50")->fetchAll(); // Get all LPAs - $lpas = db()->query("SELECT * FROM lpa_applications ORDER BY created_at DESC LIMIT 50")->fetchAll(); + $lpas = $db->query("SELECT * FROM lpa_applications ORDER BY created_at DESC LIMIT 50")->fetchAll(); + + // Get migration history + try { + $migration_history = $db->query("SELECT * FROM migration_history ORDER BY executed_at DESC")->fetchAll(); + } catch (PDOException $e) { + // migration_history might not exist yet if installer hasn't run or table not created + $migration_history = []; + } } catch (PDOException $e) { error_log($e->getMessage()); } @@ -49,11 +59,35 @@ try {
Overview of all users and applications in the system.
| File Name | +Executed At | +
|---|---|
| + | + |
| No migration history found. Run migrations to initialize. | |