Repository navigation
feat(cli): add sqb rename and sqb mv refactoring commands - #891
Merged
Merged
Conversation
…missing origins by default
…ts, and rewrite declaration references
…_migration_origin
…ascading column renames
… dbt run and build
…target, whatever the policy
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
Renaming or moving a model or column by hand means editing refs, fixtures, headers, YAML and schemas, then adding
migrate_fromso warehouse data follows.sqb renameandsqb mvdo it as one verified, all-or-nothing edit (CHI-392).Changes
sqb rename model:<old> <new>,sqb mv <model> <path>,sqb rename column:<model>.<col> <new> [--cascade]: rewrite every reference (SQL, tests, fixtures, headers, source/seed YAML,relationships, reusable schemas), compile the edited copy, then write. Refuse and change nothing when an edit is not mechanical.--dry-run,--json.migrate_fromfor tables, views, incrementals and snapshots.--cascaderenames through pass-through models; only the first set-operation branch names outputs.sqb mvmoves scoped macros, enums, constants, schemas, audits and hooks to where the placement rules require; never duplicates.missing_migration_origin = allow | require_confirmation | deny(defaultallow: warning, build fresh), also onsqb dbt run/build. An origin built in this target but no longer visible stays an M102 error.migrate_fromuntil the target has migrated it.sqb dbt run/buildnow read project/target config (previously built-in defaults), so settings such as retention-decrease policy,defer_sources_to, cursor and microbatch limits,old_name_viewsand BigQuery managed-retention planning now apply there too.Verification
make test(8289 passed),make check-ci.