Skip to content

Conversation

@babslgam
Copy link
Contributor

@babslgam babslgam commented Dec 18, 2025

  • adds schema for organisational units
  • adds migration to populate db with allowed relations between units
  • updates seeding script to add sample data related to organizational units

todo:

  • we need a constraint for unit to unit relations to prevent date range overlaps.

supersedes #26

@babslgam babslgam force-pushed the feat/add-schema-for-org-unit branch from bdd2396 to 2c34e1c Compare January 13, 2026 14:30
- add new orga unit type
- add metadata field for orga unit
populate orga unit metadatafield
populate orga unit to unit relations correctly
@babslgam babslgam marked this pull request as ready for review January 14, 2026 16:19
@stefanprobst
Copy link
Contributor

prevent date range overlaps

postgres has range types (daterange and tstzrange), which allow querying for overlaps. maybe something to try in a follow-up pr.

@stefanprobst stefanprobst changed the title feat: add model, relations for organ. units feat: add model, relations for organisational units Jan 15, 2026
Comment on lines 8 to 20
export const organisationalUnitTypes = [
"body",
"consortium",
"institution",
"umbrella_consortium",
] as const;
export const organisationalUnitStatus = [
"cooperating_partner",
"member",
"national_coordinating_institution",
"national_representative_institution",
"partner_institution",
] as const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these also live in lookup tables?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanprobst i guess yes. should we also use uuid7 in lookuptable id columns or opt for smallint?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use uuidv7 everywhere.

@babslgam babslgam requested a review from stefanprobst January 19, 2026 12:05
Copy link
Contributor

@stefanprobst stefanprobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@babslgam babslgam merged commit ad95dd7 into main Jan 19, 2026
1 check passed
@babslgam babslgam deleted the feat/add-schema-for-org-unit branch January 19, 2026 14:40
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