Open tmtmtmtm opened 8 years ago
As a slight aside: this generally seems like a very odd data model to me, forcing us to replicate every constituency for every parliamentary session. See also https://github.com/mysociety/pombola/issues/2032
It seems like it would be significantly simpler and more flexible to simply let Places have a start_date
and end_date
.
a Place can have an optional Parliamentary Session that it applies to. However there is no constraint that such a Place can only be associated with Memberships that also relate to that Parliamentary Session:
via
(The
AND NOT (o.id = 203 AND ps.house_id = 120)
is a temporary workaround to there currently being two separate Orgs for the House of Representatives — https://github.com/mysociety/pombola/issues/1974. Interestingly, a constraint on the area here might have prevented that problem, or brought it to light earlier…)