nextcloud/core/Command/Db
Rodrigo Correia 729e1e6920 feat(db): add occ db:info, db:size, db:index-usage and db:locks
Implements RFC #59422. Adds four read-only diagnostic commands to
the occ CLI for administrators to inspect database health without
needing external tools:

- db:info: shows engine version and key config variables with
  health check against recommended values
- db:size: lists all tables ordered by total disk usage
- db:index-usage: reports unused indexes via performance_schema
  (MySQL) or pg_stat_user_indexes (PostgreSQL)
- db:locks: detects active blocking transactions and deadlocks

All commands support MySQL/MariaDB and PostgreSQL. A --json flag
is available for automated parsing. Includes 31 unit tests.

Closes #59422
Signed-off-by: Rodrigo Correia <rodrigo.mendes.correia@tecnico.ulisboa.pt>
Signed-off-by: Carolina Quinteiro <carolinafquinteiro@tecnico.ulisboa.pt>
Co-authored-by: Carolina Quinteiro <carolinafquinteiro@tecnico.ulisboa.pt>
2026-05-27 13:37:40 +01:00
..
Migrations fix(db): pending migrations in occ migrations:status 2026-02-26 12:38:00 -05:00
AddMissingColumns.php style: update codestyle for coding-standard 1.2.3 2024-08-25 19:34:58 +02:00
AddMissingIndices.php fix(db): Create replacement index where original index is missing 2025-04-17 17:59:19 +02:00
AddMissingPrimaryKeys.php refactor(dbal): Port away from deprecated hasPrimaryKey 2025-10-10 15:44:43 +02:00
ConvertFilecacheBigInt.php refactor(dbal): Migrate away from Type::getName 2025-10-10 16:13:09 +02:00
ConvertMysqlToMB4.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
ConvertType.php chore: Run rector with new rules for fetch 2025-11-18 17:45:57 +01:00
DbIndexUsage.php feat(db): add occ db:info, db:size, db:index-usage and db:locks 2026-05-27 13:37:40 +01:00
DbInfo.php feat(db): add occ db:info, db:size, db:index-usage and db:locks 2026-05-27 13:37:40 +01:00
DbLocks.php feat(db): add occ db:info, db:size, db:index-usage and db:locks 2026-05-27 13:37:40 +01:00
DbSize.php feat(db): add occ db:info, db:size, db:index-usage and db:locks 2026-05-27 13:37:40 +01:00
ExpectedSchema.php refactor(psalm): Modernize migration doc 2026-02-12 11:25:55 +01:00
ExportSchema.php feat: add table filter to schema:export and schema:expected 2025-08-07 19:09:07 +02:00
SchemaEncoder.php style: update codestyle for coding-standard 1.2.3 2024-08-25 19:34:58 +02:00