-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ingestion): R24e — drop ingestion_job_stages.job_id FK (resolve drift #8) #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
supabase/migrations/20260708140000_drop_ingestion_job_stages_job_id_fkey.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| -- Audit R24e: drop ingestion_job_stages.job_id -> ingestion_jobs foreign key. | ||
| -- | ||
| -- Resolves drift-reconciliation backlog item #8 in the direction the LIVE | ||
| -- evidence supports (the opposite of the earlier "add the FK to live" plan): | ||
| -- | ||
| -- * Live never had this FK; the constraint exists only in schema.sql and the | ||
| -- migration chain, so fresh/preview databases diverge from live. | ||
| -- * The edge agent's stageStart (supabase/functions/indexing-v3-agent) writes | ||
| -- the indexing_v3_agent_jobs id into job_id, which can never satisfy a FK to | ||
| -- ingestion_jobs — so on any database where the FK exists the agent's | ||
| -- artifact-repair path dies at its first stage insert (FK 23503). | ||
| -- * Live carries 253 stage rows whose job_id has no ingestion_jobs match | ||
| -- (job deletions leave audit-log stages behind, with no FK to cascade them). | ||
| -- Adding the FK NOT VALID + VALIDATE would fail VALIDATE against those rows. | ||
| -- | ||
| -- job_id stays as an opaque correlation id (still NOT NULL). schema.sql is | ||
| -- reconciled to omit the FK and supabase/drift-allowlist.json drops its | ||
| -- now-obsolete entry in the same change. Idempotent: no-op on live (already | ||
| -- absent), removes the constraint on branch/preview databases created from the | ||
| -- pre-R24e migration chain. | ||
|
|
||
| set search_path = public, extensions, pg_temp; | ||
|
|
||
| alter table public.ingestion_job_stages | ||
| drop constraint if exists ingestion_job_stages_job_id_fkey; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.