Tables data_sources_functions and rule_type_data_sources added by migration 108 lacked a reference to their containing project.
This change adds project_id foreign key in the style of rule_instances in order to avoid future mistakes like exposing resouces by id to users that don't have rights on the containing project.
Change Type
[X] Bug fix (resolves an issue without affecting existing features)
[ ] Feature (adds new functionality without breaking changes)
[ ] Documentation (updates or additions to documentation)
[ ] Refactoring or test improvements (no bug fixes or new functionality)
Testing
Manually ran migrate up and migrate down in a database containing a few records. The aim of the test was to verify that the calculated project id was correct.
Review Checklist:
[X] Reviewed my own code for quality and clarity.
[X] Added comments to complex or tricky code sections.
[ ] Updated any affected documentation.
[ ] Included tests that validate the fix or feature.
coverage: 54.63% (+0.003%) from 54.627%
when pulling cedff5154a143bc2a064e64d2e51643ed3307c33 on fix/data_sources_migration_project_id
into c8469dde13c5e470005702f48b739f73ca5d31a0 on main.
Summary
Tables
data_sources_functions
andrule_type_data_sources
added by migration 108 lacked a reference to their containing project.This change adds
project_id
foreign key in the style ofrule_instances
in order to avoid future mistakes like exposing resouces by id to users that don't have rights on the containing project.Change Type
Testing
Manually ran
migrate up
andmigrate down
in a database containing a few records. The aim of the test was to verify that the calculated project id was correct.Review Checklist: