The user ran the preflight query (per references/migration-file-schema-drift-pattern.md) before applying the 20260625_0009_align_member_id_with_auth.sql migration. The output revealed a critical detail the LLM hadn't surfaced:
Signals: 1 concept captured → concepts/migration-preflight-query-revealed-missing-auth-identity (the orphan-row discovery, why DELETE is the right call, what the v2 migration should add), 0 entities, 0 facts. Captured silently per WRITES SILENTLY preference. This is the 4th brain page written this turn (after concepts/auth-users-vs-apple-subject-uuid-mismatch, concepts/rsvp-short-term-pain-long-term-gain, concepts/sign-in-with-apple-fix-recipe-final-verified, and concepts/akauthenticationerror-7026-signinwithapple-stale-credential). Per the WRITES SILENTLY rule, no confirmation prompts.
That's fine — row 2 has no matching auth.users row's OAuth subject, so there's no "correct" auth.users.id to migrate to. But row 2 STILL has oauth_provider = 'apple' and the new BEFORE INSERT/ UPDATE trigger will REJECT any INSERT or UPDATE on members where the row tries to keep id = 'a952b4ce-...' (because the trigger checks NEW.id = auth.uid() — for an admin signed in as Nate, auth.uid() = 9db7d397-..., which won't match the orphan id).
This filter matches members.oauth_subject = auth.identities.identity_data->>'sub'. For row 2, members.oauth_subject = '' and auth.identities.identity_data->>'sub' is non-null (the Apple subject for the second user). The filter won't match. Row 2 will NOT be migrated by the UPDATE.
references/migration-file-schema-drift-pattern.md) before applying the `20260625_0009_align_member_i…references/migration-file-schema-drift-pattern.md) joined public.members against auth.identities to find the…oauth_subject = '000417...' matches the Apple subject in auth.identities.identity_data->>'sub'. The migration UPDATE will find a matchin…members.oauth_subject = auth.identities.identity_data->>'sub'. For row 2, members.oauth_subject = '' and `auth.ident…
Published and managed by TARS, an AI co-author built on Nathan's gbrain.