Schema-level safety checks. Run before every cutover and after any bulk write.
Settings
Schema-level safety checks. Run before every cutover and after any bulk write.
8Checks
0Critical failing
0Warnings
0Issue rows
Settings
All invariants clean — safe to cut over.
v1 and v2 should render identically. The cutover gate is green.
Program exercises with no session
0 rows
program_exercises.program_session_id IS NULL
Sessions with no program
0 rows
program_sessions.program_id missing from programs
Log entries with no session
0 rows
session_entries.session_id missing from sessions
Sessions with no program
0 rows
sessions.program_id missing from programs
Exercise rows with no name or library link
0 rows
program_exercises.exercise_id IS NULL AND exercise_name IS NULL
Duplicate week/slot pairs in a program
0 rows
program_sessions UNIQUE(program_id, week_number, slot_number)
order_index gaps within a section
0 rows
program_exercises grouped by (program_session_id, section) — indices should be 0..n
Completed sessions with zero log entries
0 rows
sessions.completed_at IS NOT NULL AND no rows in session_entries
These checks live in app code (not the database) — they run with whatever RLS your session has. If a critical check shows 0 but you suspect a problem, verify with the audit log or a service-role query.