system-table-change
Installation
SKILL.md
System Table Schema Change Checklist
When adding, removing, or modifying columns or indexes on a system table, multiple files and golden test artifacts must be updated in lockstep. Missing any of these causes test failures that can be confusing to debug.
1. Schema Definition
Update the table's schema string and descriptor literal in:
pkg/sql/catalog/systemschema/system.go- The
CREATE TABLEschema string (e.g.,StatementDiagnosticsRequestsTableSchema) - The descriptor literal (e.g.,
StatementDiagnosticsRequestsTable): columns, column IDs, family column names/IDs, index store column names/IDs,NextColumnID NextColumnIDmust be max(column IDs) + 1- When adding/removing columns, update both
ColumnNamesandColumnIDsin the family descriptor - If the column should be stored in a secondary index, update both the schema string's
STORINGclause and the descriptor literal'sStoreColumnNames/StoreColumnIDs
- The
2. New Table Registration (skip if modifying existing table)
If creating a brand new system table, register it in these additional files: