Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMSBIOHUB-665: Habitat Features Database Schema #1483

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Feb 7, 2025

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-665

Description of Changes

Initial Habitat Features database schema.

Bonus:

  • Added a missing foreign key between environment_qualitative and environment_qualitative_option
  • Added index on the name column in environment_qualitative and environment_quantitative
  • Renamed database enum environment_unit to quantitative_unit
  • Added a folder for database types/units
    • Added file for database enum quantitative_unit
      • Updated references in api, and related type in app
    • Added file for database enum alert_severity
      • Updated references in api
      • Updated related tests

Testing Notes

Database migrations run as expected.
Has appropriate constraints, indexes, etc.

TODO

Table survey_habitat_feature

  • count?
  • survey_sample_period_id?
  • survey_observation_id?

If we do add survey_sample_period_id and survey_observation_id, should we restrict it to only one of them, since having both would be redundant?

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.19%. Comparing base (ce549a6) to head (01b3a80).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1483      +/-   ##
==========================================
- Coverage   47.74%   47.19%   -0.55%     
==========================================
  Files         935      928       -7     
  Lines       25844    23996    -1848     
  Branches     3978     3558     -420     
==========================================
- Hits        12340    11326    -1014     
+ Misses      12848    12065     -783     
+ Partials      656      605      -51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- Fix/update environment table foreign keys/indexes.
- Rename environment_unit database enum.
- Update api/app references to database enums.
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.

1 participant