You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues reported related to PendingModelChangesWarning, but our case is quite unique, hence I've decided to open separate issue.
I did quite isolated repro: https://github.com/dziedrius/migration-efcore-9-issue (it is in .NET 8 currently, so that it would be possible to see how behavior changes after migrating to .NET 9)
What I was able to figure out:
So as long as EF Core does not support multitenancy per schema (kind of sad, as in my opinion that is one of the clearest way to do multitenancy), we did it ourselves, it needed custom code, but kind of manageable (strongly influenced by https://github.com/Oriflame/EFCoreMultitenantSample).
The problem is, that schema is applied to migration operations just during runtime, meaning that when migrator is checking diff for source/target models, it sees different schema and hence throws the exception, seems that this check was introduced in .NET 9.
I could not figure out how I could get better control over this, so used the only workaround I knew - disabled warning, and not sure if that is a good way to approach - as I'm loosing ability to get a warning when real model mismatches will appear.
There are several issues reported related to PendingModelChangesWarning, but our case is quite unique, hence I've decided to open separate issue.
I did quite isolated repro: https://github.com/dziedrius/migration-efcore-9-issue (it is in .NET 8 currently, so that it would be possible to see how behavior changes after migrating to .NET 9)
What I was able to figure out:
So as long as EF Core does not support multitenancy per schema (kind of sad, as in my opinion that is one of the clearest way to do multitenancy), we did it ourselves, it needed custom code, but kind of manageable (strongly influenced by https://github.com/Oriflame/EFCoreMultitenantSample).
The problem is, that schema is applied to migration operations just during runtime, meaning that when migrator is checking diff for source/target models, it sees different schema and hence throws the exception, seems that this check was introduced in .NET 9.
I could not figure out how I could get better control over this, so used the only workaround I knew - disabled warning, and not sure if that is a good way to approach - as I'm loosing ability to get a warning when real model mismatches will appear.
Include provider and version information
EF Core version:
Database provider: (e.g. Npgsql.EntityFrameworkCore.PostgreSQL)
Target framework: (e.g. .NET 9.0)
The text was updated successfully, but these errors were encountered: