diff --git a/CHANGELOG.md b/CHANGELOG.md index e0af66d..d3f258c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Unreleased ## New features ## Under the hood +- Tweak tenant-lea attribution logic ## Fixes # edu_wh v0.4.0 diff --git a/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql b/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql index 7fe3bb7..bac8dbe 100644 --- a/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql +++ b/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql @@ -3,8 +3,8 @@ -- each tenant individually define each district and school, and only -- keep the definition from the tenant that actually has ownership -- since the relationship between tenant and district is not codified anywhere, --- we observe it from student enrollments. -select distinct ssa.tenant_code, lea_id -from {{ ref('stg_ef3__student_school_associations') }} ssa -join {{ ref('stg_ef3__schools') }} sch - on ssa.k_school = sch.k_school \ No newline at end of file +-- we observe it from calendars +select distinct sch.tenant_code, sch.lea_id +from {{ ref('stg_ef3__calendars') }} as cal +join {{ ref('stg_ef3__schools') }} as sch + on cal.k_school = sch.k_school