Summary
clear-data.ts truncates the M1/M2 domain + auth tables but omits the M3 tables leads (emails + consent timestamps) and email_whitelist. A "clear all data" / GDPR-erasure run silently leaves every lead in place, and the per-table try/catch masks the omission. (Docs also claim it "preserves auth_user" while it deletes all auth tables.)
Evidence
packages/data-ops/scripts/clear-data.ts:30-43 (table list) and :59-67 (sequences) — no leads, no email_whitelist.
packages/data-ops/src/drizzle/schema.ts:142-167 — both tables exist; present in all three envs' migrations.
Proposed failing test (TDD)
packages/data-ops/tests/clear-data-coverage.test.ts — "clear-data table list covers every pgTable in schema": collect table names from the schema module via getTableName; assert each domain table appears in the script's tables array. Fails on leads, email_whitelist.
Fix direction
Add both tables (and their sequences) to the list; fix the CLAUDE.md note. Consider deriving the list from the schema.
Summary
clear-data.tstruncates the M1/M2 domain + auth tables but omits the M3 tablesleads(emails + consent timestamps) andemail_whitelist. A "clear all data" / GDPR-erasure run silently leaves every lead in place, and the per-table try/catch masks the omission. (Docs also claim it "preserves auth_user" while it deletes all auth tables.)Evidence
packages/data-ops/scripts/clear-data.ts:30-43(table list) and:59-67(sequences) — noleads, noemail_whitelist.packages/data-ops/src/drizzle/schema.ts:142-167— both tables exist; present in all three envs' migrations.Proposed failing test (TDD)
packages/data-ops/tests/clear-data-coverage.test.ts—"clear-data table list covers every pgTable in schema": collect table names from the schema module viagetTableName; assert each domain table appears in the script'stablesarray. Fails onleads,email_whitelist.Fix direction
Add both tables (and their sequences) to the list; fix the CLAUDE.md note. Consider deriving the list from the schema.