-
Notifications
You must be signed in to change notification settings - Fork 8
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
MIGENG-417 replacing One-To-One with a Many-to-One #75
Open
jonathanvila
wants to merge
9
commits into
project-xavier:master
Choose a base branch
from
jonathanvila:MIGENG-417-fix-cardinality
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cdf6246
MIGENG-365 - End2end integration test (#20)
953a97c
Migeng 327 avoid crashes based on issues use cases (#68)
9677740
hotfix-kafka-autooffset set autoOffsetReset to latest (#71)
4efb927
MIGENG-114 Remove useless routes (#64)
mrizzi 3aecd4e
hotfix S3 bucket was hardcoded on the payload endpoint (#72)
186a847
MIGENG-417 replacing One-To-One with a Many-to-One
1d29aa8
MIGENG-417 replacing One-To-One with a Many-to-One
11ecbfe
Merge branch 'master' into MIGENG-417-fix-cardinality
f14ff2d
Fixed conflicts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanvila Since you are enhancing this relation I suggest we can add
optional = false
so we are 100% sure that there won't exist anyWorkloadInventoryReportModel
without anAnalysisModel
. this change should addnot null
constraint to the columnanalysis_id
into theworkload_inventory_report_model
table.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it won't make any harm, but it's totally impossible to have a null there as it has a foreign key against analysis_id where id is the primary therefore not null
"fkt966e5qfj0hwmb0oecel9qbyw" FOREIGN KEY (analysis_id) REFERENCES analysis_model(id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanvila Let me clarify my previous comment. Right now, we have a foreign key in
workload_inventory_report_model
which points toanalysis_model
; however, having a foreign key inworkload_inventory_report_model
does not force the table to contain not null values into the columnanalysis_id
. For example you can execute these commands:You will see that the previous command can be executed; it means: "I've created a workload_inventory_report_model without an analysis_model"
This is the current definition of the table, and as you can see the column
analysis_id
accept null values.I think we missed this kind of small detail in many of our current Models; however, we can improve it by the time so we have concise model definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right.
We should revisit our whole model design .... obviously that foreign key should not be nullable
This concerns me more then, that we can find other issues in the model :(
So I would suggest not doing this small change you suggests in this PR, but open another issue of revisiting the whole model adding this and all other changes needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's create a ticket for analyzing all our models.