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
In my real project, I initially created the structure using .NET 6 and have since migrated to .NET 8. Now, I need to add another property to my class, but EF Migrations tries to delete a column that doesn’t exist.
On GitHub, I’ve created a simplified version of the structure using .NET 8 and migrations. The first time you run it, the structure is created correctly. However, if you try to add another property (you don’t actually have to change anything, just execute the migrations), it tries to remove a property that doesn’t exist.
I've created a PowerShell script named "CreateAndUpdate.ps1" in the root project directory.
The script requires Firebird to be running on port 3050 and the folder 'c:\tmp' to exist.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I didn't quite understand the problem, since there are no migrations in the project, but from what you wrote, it has to do with a migration with some deletion of the column in the down method, and it hasn't been executed in the database yet.
The problem occurs when executing the CreateAndUpdate.ps1 file. This file creates the first migration, updates the database, and after that, without any modifications to the source code, tries to add another migration. In theory, nothing should have changed; however, it tries to delete a field that doesn't exist.
I’ve created the following test project to illustrate my problem: https://github.com/alansbraga/DatabaseTest
In my real project, I initially created the structure using .NET 6 and have since migrated to .NET 8. Now, I need to add another property to my class, but EF Migrations tries to delete a column that doesn’t exist.
On GitHub, I’ve created a simplified version of the structure using .NET 8 and migrations. The first time you run it, the structure is created correctly. However, if you try to add another property (you don’t actually have to change anything, just execute the migrations), it tries to remove a property that doesn’t exist.
I've created a PowerShell script named "CreateAndUpdate.ps1" in the root project directory.
The script requires Firebird to be running on port 3050 and the folder 'c:\tmp' to exist.
Thanks in advance.
The text was updated successfully, but these errors were encountered: