bcgov / bcgov/SIMS

Change locations institution code to be required on DB

Open
#1,919 0 comments 0 reactions 0 assignees View on GitHub
DB
Dominant language
TypeScript
Stars
29
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Change column `sims.education_programs_offerings.institution_code` to be required on DB.
As shown below, the field is already required on UI and it must be changed to be required also on the DB.

![image.png](https://images.zenhubusercontent.com/5fcebe3c076e6aaed83693fb/089674ca-d8fa-49ff-b93f-caa07e5e2a61)

**Additional context**
The `sims.education_programs_offerings.institution_code` has a unique constraint where the code must be unique for an institution which can make it more complex to create default values during the migration. The suggested approach would be to ensure the DEV/TEST DBs have no null entries which would allow the migration to be simplified.
A recent effort was done already on TEST DB to ensure that there is no null values on DB and the same should be done on DEV.

**Acceptance criteria**
- [ ] Manually check if there are null records on DEV/TEST DB and have then updated (select * from sims.institution_locations where institution_code is NULL)
- [ ] Create a simple DB migration to change the column to not allow null.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by verifying the issue's table references: it names sims.education_programs_offerings.institution_code, while the validation query targets sims.institution_locations. Check DEV and TEST for NULL institution_code values using the provided query, then identify the repository's database migration entry point. Done means the data is suitable for the constraint and a migration prevents NULL values.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.