Add project id foreign key to data sources tables. #5026
+88
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: