Repository navigation
fix: recreate relations missing from the warehouse snapshot - #818
Merged
Merged
Conversation
A model whose relation was dropped outside SQLBuild was still planned as built because a stored fingerprint existed: incremental models kept their cursor bounds and failed on the missing table, and views and tables reported no_change. Change detection now treats the warehouse snapshot as the source of truth for relation existence and consults stored fingerprints only when the relation exists. - Plan a first run for any model whose relation is absent, regardless of stored fingerprints, and emit a RECORDED_RELATION_MISSING plan warning when stored state recorded a previous build. - Report the built version as missing in plan JSON and expose warning codes. - Plan a seed whose relation is absent as a first run. - Let microbatch full-refresh builds create an absent live target instead of failing reconciliation.
…first-run # Conflicts: # tests/e2e/src/sqlbuild/cli/commands/main/build/_test_types.py
After integrating model migrations, the unconditional missing-relation first run preceded the RENAMED branch, so a verified rename whose destination is intentionally not created yet planned as a first run, emitted a spurious RECORDED_RELATION_MISSING warning, and replayed downstream history. Check the migration-verified rename before treating a missing relation as a first run.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
A relation dropped outside SQLBuild still planned as already built when its fingerprint remained. Incremental execution then failed against the missing table. The warehouse snapshot must determine live existence; stored records describe history.
Changes
RECORDED_RELATION_MISSINGwhen historical state exists.AGENTS.md.Verification
uv sync --all-extrasandmake check-cipass; public-content scan and diff checks pass.