-
Notifications
You must be signed in to change notification settings - Fork 223
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
Missing "public" schema fallback for migration table exists query #2787
Comments
Thanks, makes sense! I submitted #2788 to fix this, I'll also backport this. |
Cheers mate, appreciate the quick response on this! |
) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Npgsql.EntityFrameworkCore.PostgreSQL](https://togithub.com/npgsql/efcore.pg) | nuget | patch | `7.0.4` -> `7.0.11` | --- ### Release Notes <details> <summary>npgsql/efcore.pg (Npgsql.EntityFrameworkCore.PostgreSQL)</summary> ### [`v7.0.11`](https://togithub.com/npgsql/efcore.pg/releases/tag/v7.0.11) This patch release fixes a single bug ([npgsql/efcore.pg#2787), but also takes a dependency on the latest EF Core and Npgsql patch versions. Everyone is encouraged to upgrade. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,every weekend,before 5am every weekday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/orso-co/Orso.Arpa.Api). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
After upgrading to version 7.0.11, I receive the following error when running my app:
Here's a little bit of context about my app: But with your change, all DbContexts seem to try to create a __EFMigrationsHistory in the "public" schema, which, of course, isn't possible. Tomorrow I will try to create a minimal example for you to reproduce this, and open a dedicated issue. But maybe you can already have a look into this. Thanks. |
There is a subtle bug with how the migration table exists query works when dealing with a combination of defined and non-defined schemas in a database (I know that is unusual but it is what it is).
The problem is this block of code:
efcore.pg/src/EFCore.PG/Migrations/Internal/NpgsqlHistoryRepository.cs
Lines 15 to 40 in e5ade7f
If you don't specify a schema, that query will actually match against all schemas rather than filter to the default
public
schema. This means if you have a migration in another schema, that will be picked up even though it isn't valid for the current migration.As far as I can tell, you can probably just do this without the outer null-check to resolve it:
This was against
Npgsql.EntityFrameworkCore.PostgreSQL
v6.0.8Steps to recreate issue:
The text was updated successfully, but these errors were encountered: