Schema Review Checklist
Before launching: verify PKs on every table, FKs on all relationships, indexes on FKs and frequent WHERE columns, appropriate column types, and NOT NULL constraints where data is always required.
Before launching: verify PKs on every table, FKs on all relationships, indexes on FKs and frequent WHERE columns, appropriate column types, and NOT NULL constraints where data is always required.
-- Schema health queries
-- Find tables without PK
SELECT TABLE_NAME FROM information_schema.TABLES t
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME NOT IN (
SELECT TABLE_NAME FROM information_schema.TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY'
);
-- Find nullable FKs that should be NOT NULL
DESCRIBE orders;
Run schema health checks as part of your CI pipeline to catch regressions early.