Migration failed to add a field to the CatalogItem entity in CatalogContext of Catalog.API
See original GitHub issue1.First, I added a String field: Tests
public string Tests { get; set; }
2.Then, to perform the migration:
add - migration AddTests - c CatalogContext - o Infrastructure/CatalogMigrations
3.Finally, execute the project(or update-database) and report an error
After Debugging the source code, I found that the last migration record was not synchronized into the model snapshot.
This submission record has been modified. (https://github.com/dotnet-architecture/eShopOnContainers/commit/45ed8a60ad87c0da8f84f93aae143dce7e9c8bcc) But the snapshot file has not changed. (https://github.com/dotnet-architecture/eShopOnContainers/blob/dev/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs)
Causes new fields to be added to conflict.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Migrate order and order product fields [#3165421]
Problem/Motivation Running the migration using Migrate Upgrade, using core 8.9.3, the latest Commerce and all dependencies, it fails with ...
Read more >Work with data in ASP.NET Core Apps
NET Core supports various data access options, including Entity Framework Core (and Entity Framework 6 as well), and can work with any ....
Read more >Service Catalog API
The Service Catalog API provides endpoints that access Service Catalog configuration and actions from within ... Add a field to the service catalog...
Read more >Distributed transaction using SAGA pattern, RabbitMQ and ...
Distributed transaction is one that spans multiple databases across the network while preserving ACID properties.
Read more >Errors during Code First add-migration
Our add-migrations are failing routinely but not consistently. The migration always gets to the scaffolding step and then roughly 4 out of 5 ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I had intended to submit two PRs, but eventually merge together, https://github.com/dotnet-architecture/eShopOnContainers/pull/1520 I wonder if this meets your requirements.
In addition, there may still be some problems about Seed data, and I will further study it.
Hi, @sughosneo nice to hear from you again.
Regarding my issue, only need to modify the model snapshot.
On the issue of the (https://github.com/dotnet-architecture/eShopOnContainers/issues/1350), I have found the problem, do I need to submit a PR?
Just change pictureFileName to lowercase.
pictureFileName
->picturefilename
need I need to submit a PR?