Skip to content

Conversation

@hancush
Copy link
Member

@hancush hancush commented Mar 4, 2019

This PR leverages unique_together to add a unique constraint on UnitRespondingAgency, such that units may only be associated with one responding agency per year.

                                   Table "public.payroll_unitrespondingagency"
        Column        |  Type   | Collation | Nullable |                         Default
----------------------+---------+-----------+----------+----------------------------------------------------------
 id                   | integer |           | not null | nextval('payroll_unitrespondingagency_id_seq'::regclass)
 reporting_year       | integer |           | not null |
 responding_agency_id | integer |           | not null |
 unit_id              | integer |           | not null |
Indexes:
...
    "payroll_unitrespondingag_unit_id_reporting_year_988eebd6_uniq" UNIQUE CONSTRAINT, btree (unit_id, reporting_year)
...

Related to #324.

@hancush hancush requested a review from fgregg March 4, 2019 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants