Repository navigation
Add index on foreign key properties by convention - #3764
Conversation
There was a problem hiding this comment.
Will this assert fail if the application creates an index explicitly on a property created by convention?
There was a problem hiding this comment.
I have just moved the code block here so that we detach relationships before removing indexes because detaching relationship will remove FK and conventional index defined for that FK.
This assert should never fail. This is RemoveProperty function. When we add any component in the model, we update the configuration source (CS) of the property to have highest CS of all component defined using this property. At the start of this function we check if given CS is able to remove this property. If it can remove the property then all components defined using this property should get removed. Hence assert should always pass.
There was a problem hiding this comment.
Sounds good. I didn't know we did this: "we update the configuration source (CS) of the property to have highest CS of all component defined using this property."
There was a problem hiding this comment.
@ajcvickers Yes, we do that for any referenced member of the model. However we don't downgrade the CS if the referencing member is removed, that's something that would be fixed with #2869
|
|
There was a problem hiding this comment.
You need to call FindForeignKeysInHierarchy() instead to account for FKs on derived types.
|
|
f18e36c to
82455d9
Compare
7178d50 to
85dfe43
Compare
85dfe43 to
2f98ca3
Compare
Implements #700