-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Annotations not preserved with adjustindexes [NPGSQL] #829
Comments
I agree. Would you like to submit a PR or wait for me to make the change? Also in the first set of results you share above shouldn't tenant id be part of the generated migration? |
Yes it should - I manually edited the code when pasting into here and forgot about that. I can take a look at implementing the fix on monday |
@AndrewTriesToCode I experienced a weird issue that I am pretty sure is related to this change after updating my Identity API to the latest 7.x - I get the following exception:
However, I am having a hard time trying to write a unit test that makes it break since I can't figure out why the new key already has an annotation. The fix is probably as simple as this from my fork: fbjerggaard@d78b566 It could also be made even more fail-safe so we never overwrite the annotation if it already exists: foreach (var annotation in annotations)
{
if (newKey?.FindAnnotation(annotation.Name) is null)
{
newKey?.AddAnnotation(annotation.Name, annotation.Value);
}
} Which method do you prefer? |
Thanks for following up. Annotations are tough since their meaning is completely up to the data provider. I’ll take a closer look but I suspect your recommendation to simply not copy an existing annotation will do the trick. |
I liked your approach in the comment above and went ahead with it. Thanks! |
🎉 This issue has been resolved in version 8.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Using Finbuckle.MultiTenant 6.13.1 - Haven't tried in 7.0.1 but a quick look at the source tells me there are no changes in this part of the source.
Have the following code:
This results in the following migration (when creating only this index):
However, swapping those two lines in the configuration "fixes" it:
Results in the following migration:
The only part missing is the TenantID here, which is expected due to the order in the configuration.
I think it might be fixable by adding this to the
AdjustIndex
method inMultiTenantEntityTypeBuilder
The text was updated successfully, but these errors were encountered: