-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
EF 8 migration 'up' method being executed twice #33279
Comments
I can confirm, I came across the same error |
same issue on my side with
It's work well with Microsoft.EntityFrameworkCore.SqlServer 8.0.3 |
same issue on my side with
|
I noticed that issue was reported a while ago: npgsql/efcore.pg#3040 |
This is a PG-specific issue that was caused by npgsql/efcore.pg#292 in 8.0 (trigger type reloading after new types are created in the database). @maumar the cause here is the PG provider doing some special stuff, see npgsql/efcore.pg#3040 (comment); it needs to go over the migrations that have been applied, in order to possibly reload types created by those applied migrations from the database. Hopefully we'd have a way for the provider to do that without building the migration twice. |
Same goes for |
Sorry but it will be possible to have fix on target Framework net8.0 that is LTS ? |
@Maleaume that's very unlikely, EF 8.0 only receives critical, low-risk bugfixes, and doesn't seem to meet that bar. |
@roji, Thanks for the answer. I just have to know for tracability :) |
EF Core version: 8.0.2
Database provider: Npgsql 8.0.2
Target framework: net8.0
Operating system: Windows
I have migrated an application from EF 7 to EF 8 and noticed that the behavior of migrations seems to have changed.
The code above will only log 'migrating' once on EF 7 (and EF6) but is being executed twice on EF8.
This is causing issues with custom migrations that execute non-idempotent logic in their 'up' command (eg creating a transaction and performing operations on the DB using an EF context rather than using the migration builder to generate the sql)
I couldn't find this change at https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/breaking-changes
Is this expected behavior?
The text was updated successfully, but these errors were encountered: