refactor(dbt): migrate to domain-scoped schema names
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
- 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>
This commit is contained in:
@@ -22,12 +22,12 @@ models:
|
||||
staging:
|
||||
toronto:
|
||||
+materialized: view
|
||||
+schema: staging
|
||||
+schema: stg_toronto
|
||||
intermediate:
|
||||
toronto:
|
||||
+materialized: view
|
||||
+schema: intermediate
|
||||
+schema: int_toronto
|
||||
marts:
|
||||
toronto:
|
||||
+materialized: table
|
||||
+schema: marts
|
||||
+schema: mart_toronto
|
||||
|
||||
11
dbt/macros/generate_schema_name.sql
Normal file
11
dbt/macros/generate_schema_name.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Override dbt default schema name generation.
|
||||
-- Use the custom schema name directly instead of
|
||||
-- concatenating with the target schema.
|
||||
-- See: https://docs.getdbt.com/docs/build/custom-schemas
|
||||
{% macro generate_schema_name(custom_schema_name, node) %}
|
||||
{%- if custom_schema_name is none -%}
|
||||
{{ target.schema }}
|
||||
{%- else -%}
|
||||
{{ custom_schema_name | trim }}
|
||||
{%- endif -%}
|
||||
{% endmacro %}
|
||||
0
dbt/macros/toronto/.gitkeep
Normal file
0
dbt/macros/toronto/.gitkeep
Normal file
Reference in New Issue
Block a user