refactor(dbt): migrate to domain-scoped schema names #100

Merged
lmiranda merged 1 commits from feature/domain-scoped-schema-migration into development 2026-02-02 17:33:40 +00:00
Owner

Summary

  • Create generate_schema_name macro to use custom schema names directly (without public_ prefix)
  • Update dbt_project.yml schemas: stagingstg_toronto, intermediateint_toronto, martsmart_toronto
  • Add dbt/macros/toronto/ directory for future domain-specific macros
  • Fix documentation drift across multiple files

Changes

File Change
dbt/macros/generate_schema_name.sql New macro overriding dbt default schema generation
dbt/macros/toronto/.gitkeep Placeholder for domain-specific macros
dbt/dbt_project.yml Updated +schema values to domain-scoped names
docs/PROJECT_REFERENCE.md Fixed load-data-onlyload-toronto-only
docs/DATABASE_SCHEMA.md Updated schema layer table and section headers
CLAUDE.md Updated Database Schemas table
docs/runbooks/adding-dashboard.md Updated example with domain-scoped pattern

Test plan

  • dbt compile passes
  • dbt run creates 23 models in correct schemas
  • dbt test passes (61 tests)
  • pytest passes
  • ruff check passes
  • Application starts without errors
  • Database schemas verified: stg_toronto, int_toronto, mart_toronto

🤖 Generated with Claude Code

## Summary - Create `generate_schema_name` macro to use custom schema names directly (without `public_` prefix) - Update dbt_project.yml schemas: `staging`→`stg_toronto`, `intermediate`→`int_toronto`, `marts`→`mart_toronto` - Add `dbt/macros/toronto/` directory for future domain-specific macros - Fix documentation drift across multiple files ## Changes | File | Change | |------|--------| | `dbt/macros/generate_schema_name.sql` | New macro overriding dbt default schema generation | | `dbt/macros/toronto/.gitkeep` | Placeholder for domain-specific macros | | `dbt/dbt_project.yml` | Updated `+schema` values to domain-scoped names | | `docs/PROJECT_REFERENCE.md` | Fixed `load-data-only` → `load-toronto-only` | | `docs/DATABASE_SCHEMA.md` | Updated schema layer table and section headers | | `CLAUDE.md` | Updated Database Schemas table | | `docs/runbooks/adding-dashboard.md` | Updated example with domain-scoped pattern | ## Test plan - [x] `dbt compile` passes - [x] `dbt run` creates 23 models in correct schemas - [x] `dbt test` passes (61 tests) - [x] `pytest` passes - [x] `ruff check` passes - [x] Application starts without errors - [x] Database schemas verified: `stg_toronto`, `int_toronto`, `mart_toronto` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lmiranda added 1 commit 2026-02-02 17:33:01 +00:00
refactor(dbt): migrate to domain-scoped schema names
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
cda2a078d9
- Create generate_schema_name macro to use custom schema names directly
- Update dbt_project.yml schemas: staging→stg_toronto, intermediate→int_toronto, marts→mart_toronto
- Add dbt/macros/toronto/ directory for future domain-specific macros
- Fix documentation drift in PROJECT_REFERENCE.md (load-data-only→load-toronto-only)
- Update DATABASE_SCHEMA.md with new schema names
- Update CLAUDE.md database schemas table
- Update adding-dashboard.md runbook with domain-scoped pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 9e27fb8011 into development 2026-02-02 17:33:40 +00:00
lmiranda deleted branch feature/domain-scoped-schema-migration 2026-02-02 17:33:40 +00:00
Sign in to join this conversation.